/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package modelos_programa;

import java.awt.Dimension;
import java.math.BigInteger;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import jsc.distributions.Binomial;
import jsc.distributions.Poisson;
import jsc.distributions.Exponential;
import jsc.distributions.Uniform;
import javax.swing.Icon;
import javax.swing.ImageIcon;


/**
 *
 * @author HUSSEIN
 */
public class ventanaPrincipal extends javax.swing.JFrame {
    Operaciones_SQL operaciones;
    Conexion con = new Conexion();
    Connection cn=con.conectar();
    double mediaP, mediaV;
    double NumAleatorio;
    public int valor=0, sw1=0, sw2=0 ,sw3=0;
    public static ArrayList o = new ArrayList(); //guardara los datos de la columna p(x) de la tb FRECUENCIA
    public static ArrayList p = new ArrayList();   //guardara los datos de la columna P(DATOS_BIN) de la tb FRECUENCIA
    public static ArrayList DATOS_BIN = new ArrayList();
    public static ArrayList DATOS_POI = new ArrayList();
    public static ArrayList DATOS_TRI1 = new ArrayList();
    public static ArrayList DATOS_TRI2 = new ArrayList();
    public static ArrayList combinaBIN = new ArrayList();
    public static ArrayList combinaPOI = new ArrayList();
    public static ArrayList BIN_PX = new ArrayList();
    public static ArrayList POI_PX = new ArrayList();
    public static ArrayList FE_BIN = new ArrayList();
    public static ArrayList FO_BIN = new ArrayList();
    public static ArrayList FE_POI = new ArrayList();
    public static ArrayList FO_POI = new ArrayList();
    public static ArrayList randomBino = new ArrayList();
    public static ArrayList randomPoi = new ArrayList();
    public static ArrayList randomUni = new ArrayList();
    public static ArrayList randomExpo = new ArrayList();
    public static ArrayList randomTri = new ArrayList();

    /**
     * Creates new form ventanaPrincipal
     */
    public ventanaPrincipal() {
        initComponents();
        
        operaciones = new Operaciones_SQL();
        operaciones.conectar();
        operaciones.insertar("SET GENERATOR ID TO 0;");
        operaciones.insertar("SET GENERATOR ID2 TO 0;");
        operaciones.insertar("SET GENERATOR ID3 TO 0;");
        operaciones.insertar("SET GENERATOR ID4 TO 0;");
        operaciones.mostrarDatos((DefaultTableModel)tbDatos.getModel());
        operaciones.mostrarDatosDiscretos((DefaultTableModel)tbDatosDiscretos.getModel());
        operaciones.mostrarDatosContinuos((DefaultTableModel)tbDatosContinuos.getModel());
        setLocationRelativeTo(null);
        setResizable(false);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;

        panelBienvenido = new javax.swing.JTabbedPane();
        jPanel2 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel3 = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        jScrollPane4 = new javax.swing.JScrollPane();
        tbDatos = new javax.swing.JTable();
        jLabel6 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        txMedia = new javax.swing.JTextField();
        txModa = new javax.swing.JTextField();
        txDesviacion = new javax.swing.JTextField();
        txVarianza = new javax.swing.JTextField();
        txRango = new javax.swing.JTextField();
        txMinimo = new javax.swing.JTextField();
        txMaximo = new javax.swing.JTextField();
        txSuma = new javax.swing.JTextField();
        txCuenta = new javax.swing.JTextField();
        jLabel15 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jLabel29 = new javax.swing.JLabel();
        jLabel32 = new javax.swing.JLabel();
        jLabel34 = new javax.swing.JLabel();
        btnCalcular = new javax.swing.JButton();
        btnNuevo = new javax.swing.JButton();
        btnEliminar = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tbFrecuencia = new javax.swing.JTable();
        jLabel3 = new javax.swing.JLabel();
        btnCalFrec = new javax.swing.JButton();
        btnGraficar = new javax.swing.JButton();
        panelGrafico1 = new javax.swing.JPanel();
        panelGrafico2 = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        txtAleatorio = new javax.swing.JTextField();
        txtDatoAleatorio = new javax.swing.JTextField();
        btnAleatorio = new javax.swing.JButton();
        jPanel5 = new javax.swing.JPanel();
        btnMuestras = new javax.swing.JButton();
        jLabel9 = new javax.swing.JLabel();
        txtCantidad = new javax.swing.JTextField();
        jScrollPane2 = new javax.swing.JScrollPane();
        tbMuestras = new javax.swing.JTable();
        jScrollPane3 = new javax.swing.JScrollPane();
        tbMuestrasFrec = new javax.swing.JTable();
        btnCalcularFrecMue = new javax.swing.JButton();
        jButton1 = new javax.swing.JButton();
        panelHistograma = new javax.swing.JPanel();
        carga = new javax.swing.JLabel();
        jPanel6 = new javax.swing.JPanel();
        jTabbedPane2 = new javax.swing.JTabbedPane();
        jPanel7 = new javax.swing.JPanel();
        jLabel10 = new javax.swing.JLabel();
        jScrollPane5 = new javax.swing.JScrollPane();
        tbDatosDiscretos = new javax.swing.JTable();
        jLabel14 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        txMediaD = new javax.swing.JTextField();
        txModaD = new javax.swing.JTextField();
        txDesviacionD = new javax.swing.JTextField();
        txVarianzaD = new javax.swing.JTextField();
        txRangoD = new javax.swing.JTextField();
        txMinimoD = new javax.swing.JTextField();
        txMaximoD = new javax.swing.JTextField();
        txSumaD = new javax.swing.JTextField();
        txCuentaD = new javax.swing.JTextField();
        jLabel24 = new javax.swing.JLabel();
        jLabel25 = new javax.swing.JLabel();
        jLabel30 = new javax.swing.JLabel();
        jLabel33 = new javax.swing.JLabel();
        jLabel35 = new javax.swing.JLabel();
        btnCalcular1 = new javax.swing.JButton();
        btnNuevo1 = new javax.swing.JButton();
        btnEliminarDis = new javax.swing.JButton();
        comboAlfa = new javax.swing.JComboBox();
        jLabel70 = new javax.swing.JLabel();
        jLabel71 = new javax.swing.JLabel();
        jLabel72 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        btnHistoDist = new javax.swing.JButton();
        labelRBIN = new javax.swing.JLabel();
        labelRPOI = new javax.swing.JLabel();
        jPanel8 = new javax.swing.JPanel();
        jScrollPane6 = new javax.swing.JScrollPane();
        TBbinomial = new javax.swing.JTable();
        jLabel26 = new javax.swing.JLabel();
        Panelbinomial = new javax.swing.JPanel();
        jLabel27 = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        txt_p = new javax.swing.JTextField();
        txt_N = new javax.swing.JTextField();
        jLabel31 = new javax.swing.JLabel();
        txtChiBinCalculado = new javax.swing.JTextField();
        jSeparator1 = new javax.swing.JSeparator();
        jLabel36 = new javax.swing.JLabel();
        TEST_CHI2 = new javax.swing.JTextField();
        jLabel38 = new javax.swing.JLabel();
        PanelbinomialAle = new javax.swing.JPanel();
        jLabel39 = new javax.swing.JLabel();
        txtCantidadBin = new javax.swing.JTextField();
        jScrollPane7 = new javax.swing.JScrollPane();
        TBbinomialaAle = new javax.swing.JTable();
        bntGenAleBin = new javax.swing.JButton();
        jPanel13 = new javax.swing.JPanel();
        jScrollPane13 = new javax.swing.JScrollPane();
        TBpoisson = new javax.swing.JTable();
        jLabel46 = new javax.swing.JLabel();
        PanelPoisson = new javax.swing.JPanel();
        jLabel65 = new javax.swing.JLabel();
        txtLamdaPoisson = new javax.swing.JTextField();
        jLabel74 = new javax.swing.JLabel();
        txtChiPoiCalculado = new javax.swing.JTextField();
        jSeparator4 = new javax.swing.JSeparator();
        jLabel75 = new javax.swing.JLabel();
        TEST_CHI2_pos = new javax.swing.JTextField();
        jLabel76 = new javax.swing.JLabel();
        PanelAlePoisson = new javax.swing.JPanel();
        jLabel77 = new javax.swing.JLabel();
        txtCantidadPos = new javax.swing.JTextField();
        jScrollPane14 = new javax.swing.JScrollPane();
        TBpoissonAle = new javax.swing.JTable();
        bntGenAlePos = new javax.swing.JButton();
        jPanel9 = new javax.swing.JPanel();
        jTabbedPane3 = new javax.swing.JTabbedPane();
        jPanel10 = new javax.swing.JPanel();
        jLabel40 = new javax.swing.JLabel();
        jScrollPane8 = new javax.swing.JScrollPane();
        tbDatosContinuos = new javax.swing.JTable();
        jLabel41 = new javax.swing.JLabel();
        jLabel42 = new javax.swing.JLabel();
        jLabel43 = new javax.swing.JLabel();
        jLabel44 = new javax.swing.JLabel();
        jLabel45 = new javax.swing.JLabel();
        txMediaC = new javax.swing.JTextField();
        txModaC = new javax.swing.JTextField();
        txDesviacionC = new javax.swing.JTextField();
        txVarianzaC = new javax.swing.JTextField();
        txRangoC = new javax.swing.JTextField();
        txMinimoC = new javax.swing.JTextField();
        txMaximoC = new javax.swing.JTextField();
        txSumaC = new javax.swing.JTextField();
        txCuentaC = new javax.swing.JTextField();
        jLabel47 = new javax.swing.JLabel();
        jLabel48 = new javax.swing.JLabel();
        jLabel49 = new javax.swing.JLabel();
        jLabel50 = new javax.swing.JLabel();
        jLabel51 = new javax.swing.JLabel();
        btnCalcular2 = new javax.swing.JButton();
        btnNuevo2 = new javax.swing.JButton();
        btnEliminarCon = new javax.swing.JButton();
        jLabel62 = new javax.swing.JLabel();
        jLabel68 = new javax.swing.JLabel();
        jLabel69 = new javax.swing.JLabel();
        comboNConfianza = new javax.swing.JComboBox();
        jLabel37 = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        jPanel15 = new javax.swing.JPanel();
        btnHistoCont = new javax.swing.JButton();
        labelRUNI = new javax.swing.JLabel();
        labelREXP = new javax.swing.JLabel();
        labelRTRI = new javax.swing.JLabel();
        jPanel11 = new javax.swing.JPanel();
        jScrollPane9 = new javax.swing.JScrollPane();
        TBuniforme = new javax.swing.JTable();
        jLabel52 = new javax.swing.JLabel();
        Paneluniforme = new javax.swing.JPanel();
        jLabel53 = new javax.swing.JLabel();
        jLabel54 = new javax.swing.JLabel();
        txt_A = new javax.swing.JTextField();
        txt_B = new javax.swing.JTextField();
        jLabel55 = new javax.swing.JLabel();
        DCalculadoUni = new javax.swing.JTextField();
        jSeparator2 = new javax.swing.JSeparator();
        jLabel56 = new javax.swing.JLabel();
        TEST_KS_UNI = new javax.swing.JTextField();
        jLabel58 = new javax.swing.JLabel();
        PaneluniformeAle = new javax.swing.JPanel();
        jLabel59 = new javax.swing.JLabel();
        txtCantidadUni = new javax.swing.JTextField();
        jScrollPane10 = new javax.swing.JScrollPane();
        TBuniformeAle = new javax.swing.JTable();
        bntGenAleUni = new javax.swing.JButton();
        jPanel12 = new javax.swing.JPanel();
        jScrollPane11 = new javax.swing.JScrollPane();
        TBexponencial = new javax.swing.JTable();
        jLabel60 = new javax.swing.JLabel();
        PanelExponencial = new javax.swing.JPanel();
        jLabel61 = new javax.swing.JLabel();
        txt_LambaExp = new javax.swing.JTextField();
        jLabel63 = new javax.swing.JLabel();
        DCalculadoExp = new javax.swing.JTextField();
        jSeparator3 = new javax.swing.JSeparator();
        jLabel64 = new javax.swing.JLabel();
        TEST_KS_EXP = new javax.swing.JTextField();
        jLabel66 = new javax.swing.JLabel();
        PanelExponencialAle = new javax.swing.JPanel();
        jLabel67 = new javax.swing.JLabel();
        txtCantidadExp = new javax.swing.JTextField();
        jScrollPane12 = new javax.swing.JScrollPane();
        TBexponencialAle = new javax.swing.JTable();
        bntGenAleExp = new javax.swing.JButton();
        jPanel14 = new javax.swing.JPanel();
        jScrollPane15 = new javax.swing.JScrollPane();
        TBtriangular = new javax.swing.JTable();
        jLabel73 = new javax.swing.JLabel();
        Paneltriangular = new javax.swing.JPanel();
        jLabel78 = new javax.swing.JLabel();
        jLabel79 = new javax.swing.JLabel();
        txt_At = new javax.swing.JTextField();
        txt_Bt = new javax.swing.JTextField();
        jLabel80 = new javax.swing.JLabel();
        DCalculadoTri = new javax.swing.JTextField();
        jSeparator5 = new javax.swing.JSeparator();
        jLabel81 = new javax.swing.JLabel();
        TEST_KS_TRI = new javax.swing.JTextField();
        jLabel83 = new javax.swing.JLabel();
        PaneltriangularAle = new javax.swing.JPanel();
        jLabel84 = new javax.swing.JLabel();
        txtCantidadTri = new javax.swing.JTextField();
        jScrollPane16 = new javax.swing.JScrollPane();
        TBtriangularAle = new javax.swing.JTable();
        bntGenAleTri = new javax.swing.JButton();
        jLabel85 = new javax.swing.JLabel();
        txt_Ct = new javax.swing.JTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Proyecto Modelos y Simulacion");

        jPanel2.setLayout(new java.awt.GridBagLayout());

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N
        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recursos/BIENVENIDO.png"))); // NOI18N
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        jPanel2.add(jLabel1, gridBagConstraints);

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recursos/DATOS_INFORMATIVOS.png"))); // NOI18N
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(30, 50, 0, 20);
        jPanel2.add(jLabel2, gridBagConstraints);

        jLabel8.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recursos/uta.png"))); // NOI18N
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.insets = new java.awt.Insets(30, 20, 50, 50);
        jPanel2.add(jLabel8, gridBagConstraints);

        panelBienvenido.addTab("BIENVENIDO", jPanel2);

        jPanel3.setLayout(new java.awt.GridBagLayout());

        jLabel5.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel5.setText("INFORMACIÓN RECOLECTADA:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.gridwidth = 3;
        gridBagConstraints.ipadx = 19;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(21, 25, 0, 0);
        jPanel3.add(jLabel5, gridBagConstraints);

        tbDatos.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        jScrollPane4.setViewportView(tbDatos);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.gridwidth = 4;
        gridBagConstraints.gridheight = 14;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 1.0;
        gridBagConstraints.insets = new java.awt.Insets(10, 25, 40, 0);
        jPanel3.add(jScrollPane4, gridBagConstraints);

        jLabel6.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel6.setText("ESTADÍSTICA DESCRIPTIVA");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.gridwidth = 2;
        jPanel3.add(jLabel6, gridBagConstraints);

        jLabel12.setText("Desviación E:................................ ");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 6;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 100, 0, 0);
        jPanel3.add(jLabel12, gridBagConstraints);

        jLabel13.setText("Varianza:.....................................");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 7;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 100, 0, 0);
        jPanel3.add(jLabel13, gridBagConstraints);

        jLabel16.setText("Minimo:.......................................");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 11;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 100, 0, 0);
        jPanel3.add(jLabel16, gridBagConstraints);

        jLabel20.setText("Cuenta:......................................");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 14;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 100, 0, 0);
        jPanel3.add(jLabel20, gridBagConstraints);

        txMedia.setEditable(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(10, 5, 0, 100);
        jPanel3.add(txMedia, gridBagConstraints);

        txModa.setEditable(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 5;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 5, 0, 100);
        jPanel3.add(txModa, gridBagConstraints);

        txDesviacion.setEditable(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 6;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 5, 0, 100);
        jPanel3.add(txDesviacion, gridBagConstraints);

        txVarianza.setEditable(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 7;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 5, 0, 100);
        jPanel3.add(txVarianza, gridBagConstraints);

        txRango.setEditable(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 10;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 5, 0, 100);
        jPanel3.add(txRango, gridBagConstraints);

        txMinimo.setEditable(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 11;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 5, 0, 100);
        jPanel3.add(txMinimo, gridBagConstraints);

        txMaximo.setEditable(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 12;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 5, 0, 100);
        jPanel3.add(txMaximo, gridBagConstraints);

        txSuma.setEditable(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 13;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 5, 0, 100);
        jPanel3.add(txSuma, gridBagConstraints);

        txCuenta.setEditable(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 14;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.ipadx = 100;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 5, 0, 100);
        jPanel3.add(txCuenta, gridBagConstraints);

        jLabel15.setText("Moda:........................................");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 5;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 100, 0, 0);
        jPanel3.add(jLabel15, gridBagConstraints);

        jLabel19.setText("Media:........................................");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(10, 100, 0, 0);
        jPanel3.add(jLabel19, gridBagConstraints);

        jLabel29.setText("Maximo:......................................");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 12;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 100, 0, 0);
        jPanel3.add(jLabel29, gridBagConstraints);

        jLabel32.setText("Rango:.......................................");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 10;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 100, 0, 0);
        jPanel3.add(jLabel32, gridBagConstraints);

        jLabel34.setText("Suma:........................................");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 13;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 100, 0, 0);
        jPanel3.add(jLabel34, gridBagConstraints);

        btnCalcular.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        btnCalcular.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recursos/Control Panel-16.png"))); // NOI18N
        btnCalcular.setText("Calcular");
        btnCalcular.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCalcularActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 3;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST;
        gridBagConstraints.insets = new java.awt.Insets(15, 16, 0, 0);
        jPanel3.add(btnCalcular, gridBagConstraints);

        btnNuevo.setText("Agregar Datos");
        btnNuevo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNuevoActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(15, 25, 0, 0);
        jPanel3.add(btnNuevo, gridBagConstraints);

        btnEliminar.setText("Eliminar");
        btnEliminar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEliminarActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.insets = new java.awt.Insets(15, 12, 0, 0);
        jPanel3.add(btnEliminar, gridBagConstraints);

        jTabbedPane1.addTab("Datos", jPanel3);

        tbFrecuencia.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        jScrollPane1.setViewportView(tbFrecuencia);

        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel3.setText("FRECUENCIAS");

        btnCalFrec.setText("Mostrar");
        btnCalFrec.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCalFrecActionPerformed(evt);
            }
        });

        btnGraficar.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        btnGraficar.setText("Graficar");
        btnGraficar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnGraficarActionPerformed(evt);
            }
        });

        panelGrafico1.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        javax.swing.GroupLayout panelGrafico1Layout = new javax.swing.GroupLayout(panelGrafico1);
        panelGrafico1.setLayout(panelGrafico1Layout);
        panelGrafico1Layout.setHorizontalGroup(
            panelGrafico1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 491, Short.MAX_VALUE)
        );
        panelGrafico1Layout.setVerticalGroup(
            panelGrafico1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 231, Short.MAX_VALUE)
        );

        panelGrafico2.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        javax.swing.GroupLayout panelGrafico2Layout = new javax.swing.GroupLayout(panelGrafico2);
        panelGrafico2.setLayout(panelGrafico2Layout);
        panelGrafico2Layout.setHorizontalGroup(
            panelGrafico2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 491, Short.MAX_VALUE)
        );
        panelGrafico2Layout.setVerticalGroup(
            panelGrafico2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 231, Short.MAX_VALUE)
        );

        jLabel4.setText("NÚMERO ALEATORIO (0-1):...............");

        jLabel7.setText("DATO OBTENIDO:...........................");

        txtAleatorio.setEditable(false);

        txtDatoAleatorio.setEditable(false);
        txtDatoAleatorio.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N

        btnAleatorio.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        btnAleatorio.setText("Aleatorio");
        btnAleatorio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAleatorioActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGap(33, 33, 33)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(btnCalFrec)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnGraficar))
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 299, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel4)
                            .addComponent(jLabel7))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtDatoAleatorio)
                            .addComponent(txtAleatorio)
                            .addComponent(btnAleatorio, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 49, Short.MAX_VALUE)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(panelGrafico1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(panelGrafico2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(52, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGap(31, 31, 31)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel3)
                            .addComponent(btnGraficar)
                            .addComponent(btnCalFrec))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 266, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(31, 31, 31)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel4)
                            .addComponent(txtAleatorio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel7)
                            .addComponent(txtDatoAleatorio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addComponent(btnAleatorio))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(panelGrafico1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(panelGrafico2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(59, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Frecuencia", jPanel4);

        btnMuestras.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        btnMuestras.setText("Insertar muestras");
        btnMuestras.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                btnMuestrasMouseReleased(evt);
            }
            public void mousePressed(java.awt.event.MouseEvent evt) {
                btnMuestrasMousePressed(evt);
            }
        });
        btnMuestras.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnMuestrasActionPerformed(evt);
            }
        });

        jLabel9.setText("Cantidad:");

        tbMuestras.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        jScrollPane2.setViewportView(tbMuestras);

        tbMuestrasFrec.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        jScrollPane3.setViewportView(tbMuestrasFrec);

        btnCalcularFrecMue.setText("Calcular");
        btnCalcularFrecMue.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCalcularFrecMueActionPerformed(evt);
            }
        });

        jButton1.setText("Graficar");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        panelHistograma.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        javax.swing.GroupLayout panelHistogramaLayout = new javax.swing.GroupLayout(panelHistograma);
        panelHistograma.setLayout(panelHistogramaLayout);
        panelHistogramaLayout.setHorizontalGroup(
            panelHistogramaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );
        panelHistogramaLayout.setVerticalGroup(
            panelHistogramaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 233, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGap(22, 22, 22)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .addComponent(btnMuestras, javax.swing.GroupLayout.DEFAULT_SIZE, 166, Short.MAX_VALUE)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jLabel9)
                        .addGap(18, 18, 18)
                        .addComponent(txtCantidad)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 54, Short.MAX_VALUE)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(btnCalcularFrecMue)
                        .addGap(18, 18, 18)
                        .addComponent(jButton1))
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 629, Short.MAX_VALUE)
                    .addComponent(panelHistograma, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(carga, javax.swing.GroupLayout.PREFERRED_SIZE, 229, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(57, Short.MAX_VALUE))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGap(28, 28, 28)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnMuestras)
                    .addComponent(btnCalcularFrecMue)
                    .addComponent(jButton1))
                .addGap(18, 18, 18)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(carga, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel9)
                        .addComponent(txtCantidad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(18, 18, 18)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 460, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 205, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(panelHistograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Muestras Aleatorias e Histograma", jPanel5);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 933, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane1)
                .addContainerGap())
        );

        panelBienvenido.addTab("DISTRIBUCIÓN DE PROBABILIDAD", jPanel1);

        jPanel7.setLayout(new java.awt.GridBagLayout());

        jLabel10.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel10.setText("INFORMACIÓN RECOLECTADA DATOS DISCRETOS:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.gridwidth = 4;
        gridBagConstraints.ipadx = 19;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(21, 25, 0, 0);
        jPanel7.add(jLabel10, gridBagConstraints);

        tbDatosDiscretos.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        jScrollPane5.setViewportView(tbDatosDiscretos);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.gridwidth = 4;
        gridBagConstraints.gridheight = 16;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 1.0;
        gridBagConstraints.insets = new java.awt.Insets(10, 25, 0, 0);
        jPanel7.add(jScrollPane5, gridBagConstraints);

        jLabel14.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel14.setText("ESTADÍSTICA DESCRIPTIVA DATOS DISCRETOS");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.gridwidth = 2;
        jPanel7.add(jLabel14, gridBagConstraints);

        jLabel17.setText("Desviación E:................................ ");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 7;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 100, 0, 0);
        jPanel7.add(jLabel17, gridBagConstraints);

        jLabel18.setText("Varianza:.....................................");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 8;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 100, 0, 0);
        jPanel7.add(jLabel18, gridBagConstraints);

        jLabel21.setText("Minimo:.......................................");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 12;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 100, 0, 0);
        jPanel7.add(jLabel21, gridBagConstraints);

        jLabel22.setText("Cuenta:......................................");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 15;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 100, 0, 0);
        jPanel7.add(jLabel22, gridBagConstraints);

        txMediaD.setEditable(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(10, 5, 0, 100);
        jPanel7.add(txMediaD, gridBagConstraints);

        txModaD.setEditable(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 6;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 5, 0, 100);
        jPanel7.add(txModaD, gridBagConstraints);

        txDesviacionD.setEditable(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 7;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 5, 0, 100);
        jPanel7.add(txDesviacionD, gridBagConstraints);

        txVarianzaD.setEditable(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 8;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 5, 0, 100);
        jPanel7.add(txVarianzaD, gridBagConstraints);

        txRangoD.setEditable(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 11;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 5, 0, 100);
        jPanel7.add(txRangoD, gridBagConstraints);

        txMinimoD.setEditable(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 12;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 5, 0, 100);
        jPanel7.add(txMinimoD, gridBagConstraints);

        txMaximoD.setEditable(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 13;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 5, 0, 100);
        jPanel7.add(txMaximoD, gridBagConstraints);

        txSumaD.setEditable(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 14;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 5, 0, 100);
        jPanel7.add(txSumaD, gridBagConstraints);

        txCuentaD.setEditable(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 15;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.ipadx = 100;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 5, 0, 100);
        jPanel7.add(txCuentaD, gridBagConstraints);

        jLabel24.setText("Moda:........................................");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 6;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 100, 0, 0);
        jPanel7.add(jLabel24, gridBagConstraints);

        jLabel25.setText("Media:........................................");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(10, 100, 0, 0);
        jPanel7.add(jLabel25, gridBagConstraints);

        jLabel30.setText("Maximo:......................................");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 13;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 100, 0, 0);
        jPanel7.add(jLabel30, gridBagConstraints);

        jLabel33.setText("Rango:.......................................");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 11;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 100, 0, 0);
        jPanel7.add(jLabel33, gridBagConstraints);

        jLabel35.setText("Suma:........................................");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 14;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 100, 0, 0);
        jPanel7.add(jLabel35, gridBagConstraints);

        btnCalcular1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        btnCalcular1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recursos/Control Panel-16.png"))); // NOI18N
        btnCalcular1.setText("Calcular");
        btnCalcular1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCalcular1ActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 12, 0, 0);
        jPanel7.add(btnCalcular1, gridBagConstraints);

        btnNuevo1.setText("Agregar Datos");
        btnNuevo1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNuevo1ActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 25, 0, 0);
        jPanel7.add(btnNuevo1, gridBagConstraints);

        btnEliminarDis.setText("Eliminar");
        btnEliminarDis.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEliminarDisActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.insets = new java.awt.Insets(5, 12, 0, 0);
        jPanel7.add(btnEliminarDis, gridBagConstraints);

        comboAlfa.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0.999", "0.995", "0.99", "0.975", "0.95", "0.90", "0.75", "0.50", "0.25", "0.10", "0.05", "0.025", "0.01", "0.005", "0.001"}));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 3;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.insets = new java.awt.Insets(5, 12, 0, 0);
        jPanel7.add(comboAlfa, gridBagConstraints);

        jLabel70.setText("Significancia:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 3;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(15, 12, 0, 0);
        jPanel7.add(jLabel70, gridBagConstraints);

        jLabel71.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel71.setText("RESULTADOS:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 16;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.insets = new java.awt.Insets(25, 0, 0, 0);
        jPanel7.add(jLabel71, gridBagConstraints);

        jLabel72.setText("BINOMIAL");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 17;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(25, 100, 0, 0);
        jPanel7.add(jLabel72, gridBagConstraints);

        jLabel11.setText("POISSON");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 18;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 100, 0, 0);
        jPanel7.add(jLabel11, gridBagConstraints);

        btnHistoDist.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recursos/Chart-flipped-32.png"))); // NOI18N
        btnHistoDist.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnHistoDistActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 3;
        gridBagConstraints.gridy = 19;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 10, 0);
        jPanel7.add(btnHistoDist, gridBagConstraints);

        labelRBIN.setText(".......");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 17;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST;
        gridBagConstraints.insets = new java.awt.Insets(25, 0, 0, 100);
        jPanel7.add(labelRBIN, gridBagConstraints);

        labelRPOI.setText(".......");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 18;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 100);
        jPanel7.add(labelRPOI, gridBagConstraints);

        jTabbedPane2.addTab("Datos Discretos", jPanel7);

        TBbinomial.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        jScrollPane6.setViewportView(TBbinomial);

        jLabel26.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel26.setText("PARAMETROS:");

        Panelbinomial.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        javax.swing.GroupLayout PanelbinomialLayout = new javax.swing.GroupLayout(Panelbinomial);
        Panelbinomial.setLayout(PanelbinomialLayout);
        PanelbinomialLayout.setHorizontalGroup(
            PanelbinomialLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 331, Short.MAX_VALUE)
        );
        PanelbinomialLayout.setVerticalGroup(
            PanelbinomialLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 269, Short.MAX_VALUE)
        );

        jLabel27.setText("p......");

        jLabel28.setText("n......");

        txt_p.setEditable(false);

        txt_N.setEditable(false);

        jLabel31.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel31.setText("CHI...");

        txtChiBinCalculado.setEditable(false);
        txtChiBinCalculado.setBackground(new java.awt.Color(153, 204, 255));

        jLabel36.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel36.setText("Prueba CHI CUADRADO:");

        TEST_CHI2.setEditable(false);

        jLabel38.setText("GENERAR ALEATORIOS");

        PanelbinomialAle.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        javax.swing.GroupLayout PanelbinomialAleLayout = new javax.swing.GroupLayout(PanelbinomialAle);
        PanelbinomialAle.setLayout(PanelbinomialAleLayout);
        PanelbinomialAleLayout.setHorizontalGroup(
            PanelbinomialAleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 325, Short.MAX_VALUE)
        );
        PanelbinomialAleLayout.setVerticalGroup(
            PanelbinomialAleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );

        jLabel39.setText("#....");

        TBbinomialaAle.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        jScrollPane7.setViewportView(TBbinomialaAle);

        bntGenAleBin.setText("Generar");
        bntGenAleBin.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bntGenAleBinActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createSequentialGroup()
                .addGap(33, 33, 33)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addComponent(jLabel26)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createSequentialGroup()
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jScrollPane7, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel8Layout.createSequentialGroup()
                                .addComponent(jLabel31)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(txtChiBinCalculado))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel8Layout.createSequentialGroup()
                                .addComponent(jLabel28)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(txt_N))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel8Layout.createSequentialGroup()
                                .addComponent(jLabel27)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(txt_p))
                            .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel36, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(TEST_CHI2))
                        .addGap(18, 18, 18))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createSequentialGroup()
                        .addComponent(jLabel38, javax.swing.GroupLayout.DEFAULT_SIZE, 120, Short.MAX_VALUE)
                        .addGap(79, 79, 79))
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addComponent(jLabel39)
                        .addGap(18, 18, 18)
                        .addComponent(txtCantidadBin, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(bntGenAleBin)
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addComponent(PanelbinomialAle, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(Panelbinomial, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 670, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(26, 26, 26))
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addGap(35, 35, 35)
                .addComponent(jLabel26)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel27)
                            .addComponent(txt_p, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel28)
                            .addComponent(txt_N, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel31)
                            .addComponent(txtChiBinCalculado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel36)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(TEST_CHI2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 201, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(Panelbinomial, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(PanelbinomialAle, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addComponent(jLabel38)
                        .addGap(20, 20, 20)
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel39)
                            .addComponent(txtCantidadBin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(bntGenAleBin))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 201, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(31, Short.MAX_VALUE))
        );

        jTabbedPane2.addTab("BINOMIAL", jPanel8);

        TBpoisson.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        jScrollPane13.setViewportView(TBpoisson);

        jLabel46.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel46.setText("PARAMETROS:");

        PanelPoisson.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        javax.swing.GroupLayout PanelPoissonLayout = new javax.swing.GroupLayout(PanelPoisson);
        PanelPoisson.setLayout(PanelPoissonLayout);
        PanelPoissonLayout.setHorizontalGroup(
            PanelPoissonLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 331, Short.MAX_VALUE)
        );
        PanelPoissonLayout.setVerticalGroup(
            PanelPoissonLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 269, Short.MAX_VALUE)
        );

        jLabel65.setText("Lamda");

        txtLamdaPoisson.setEditable(false);

        jLabel74.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel74.setText("CHI...");

        txtChiPoiCalculado.setEditable(false);
        txtChiPoiCalculado.setBackground(new java.awt.Color(153, 204, 255));

        jLabel75.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel75.setText("Prueba CHI CUADRADO:");

        TEST_CHI2_pos.setEditable(false);

        jLabel76.setText("GENERAR ALEATORIOS");

        PanelAlePoisson.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        javax.swing.GroupLayout PanelAlePoissonLayout = new javax.swing.GroupLayout(PanelAlePoisson);
        PanelAlePoisson.setLayout(PanelAlePoissonLayout);
        PanelAlePoissonLayout.setHorizontalGroup(
            PanelAlePoissonLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 325, Short.MAX_VALUE)
        );
        PanelAlePoissonLayout.setVerticalGroup(
            PanelAlePoissonLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );

        jLabel77.setText("#....");

        TBpoissonAle.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        jScrollPane14.setViewportView(TBpoissonAle);

        bntGenAlePos.setText("Generar");
        bntGenAlePos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bntGenAlePosActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
        jPanel13.setLayout(jPanel13Layout);
        jPanel13Layout.setHorizontalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel13Layout.createSequentialGroup()
                .addGap(33, 33, 33)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel13Layout.createSequentialGroup()
                        .addComponent(jLabel46)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel13Layout.createSequentialGroup()
                        .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jScrollPane14, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel13Layout.createSequentialGroup()
                                .addComponent(jLabel74)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(txtChiPoiCalculado))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel13Layout.createSequentialGroup()
                                .addComponent(jLabel65)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(txtLamdaPoisson))
                            .addComponent(jSeparator4, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel75, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(TEST_CHI2_pos))
                        .addGap(18, 18, 18))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel13Layout.createSequentialGroup()
                        .addComponent(jLabel76, javax.swing.GroupLayout.DEFAULT_SIZE, 120, Short.MAX_VALUE)
                        .addGap(79, 79, 79))
                    .addGroup(jPanel13Layout.createSequentialGroup()
                        .addComponent(jLabel77)
                        .addGap(18, 18, 18)
                        .addComponent(txtCantidadPos, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(bntGenAlePos)
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel13Layout.createSequentialGroup()
                        .addComponent(PanelAlePoisson, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(PanelPoisson, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane13, javax.swing.GroupLayout.PREFERRED_SIZE, 670, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(26, 26, 26))
        );
        jPanel13Layout.setVerticalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup()
                .addGap(35, 35, 35)
                .addComponent(jLabel46)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel13Layout.createSequentialGroup()
                        .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel65)
                            .addComponent(txtLamdaPoisson, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel74)
                            .addComponent(txtChiPoiCalculado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jSeparator4, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel75)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(TEST_CHI2_pos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane13, javax.swing.GroupLayout.PREFERRED_SIZE, 201, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(PanelPoisson, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(PanelAlePoisson, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanel13Layout.createSequentialGroup()
                        .addComponent(jLabel76)
                        .addGap(20, 20, 20)
                        .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel77)
                            .addComponent(txtCantidadPos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(bntGenAlePos))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jScrollPane14, javax.swing.GroupLayout.PREFERRED_SIZE, 201, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(31, Short.MAX_VALUE))
        );

        jTabbedPane2.addTab("POISSON", jPanel13);

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 933, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane2)
                .addContainerGap())
        );

        panelBienvenido.addTab("DISTRIBUCIONES DISCRETAS", jPanel6);

        jPanel10.setLayout(new java.awt.GridBagLayout());

        jLabel40.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel40.setText("INFORMACIÓN RECOLECTADA DATOS CONTINUOS:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.gridwidth = 3;
        gridBagConstraints.ipadx = 19;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(21, 25, 0, 0);
        jPanel10.add(jLabel40, gridBagConstraints);

        tbDatosContinuos.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        jScrollPane8.setViewportView(tbDatosContinuos);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.gridwidth = 4;
        gridBagConstraints.gridheight = 13;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 1.0;
        gridBagConstraints.insets = new java.awt.Insets(10, 25, 0, 0);
        jPanel10.add(jScrollPane8, gridBagConstraints);

        jLabel41.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel41.setText("ESTADÍSTICA DESCRIPTIVA DATOS CONTINUOS");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.gridwidth = 2;
        jPanel10.add(jLabel41, gridBagConstraints);

        jLabel42.setText("Desviación E:................................ ");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 5;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 100, 0, 0);
        jPanel10.add(jLabel42, gridBagConstraints);

        jLabel43.setText("Varianza:.....................................");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 6;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 100, 0, 0);
        jPanel10.add(jLabel43, gridBagConstraints);

        jLabel44.setText("Minimo:.......................................");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 8;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 100, 0, 0);
        jPanel10.add(jLabel44, gridBagConstraints);

        jLabel45.setText("Cuenta:......................................");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 11;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 100, 0, 0);
        jPanel10.add(jLabel45, gridBagConstraints);

        txMediaC.setEditable(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(10, 5, 0, 100);
        jPanel10.add(txMediaC, gridBagConstraints);

        txModaC.setEditable(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 5, 0, 100);
        jPanel10.add(txModaC, gridBagConstraints);

        txDesviacionC.setEditable(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 5;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 5, 0, 100);
        jPanel10.add(txDesviacionC, gridBagConstraints);

        txVarianzaC.setEditable(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 6;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 5, 0, 100);
        jPanel10.add(txVarianzaC, gridBagConstraints);

        txRangoC.setEditable(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 7;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 5, 0, 100);
        jPanel10.add(txRangoC, gridBagConstraints);

        txMinimoC.setEditable(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 8;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 5, 0, 100);
        jPanel10.add(txMinimoC, gridBagConstraints);

        txMaximoC.setEditable(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 9;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 5, 0, 100);
        jPanel10.add(txMaximoC, gridBagConstraints);

        txSumaC.setEditable(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 10;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 5, 0, 100);
        jPanel10.add(txSumaC, gridBagConstraints);

        txCuentaC.setEditable(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 11;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.ipadx = 100;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 5, 0, 100);
        jPanel10.add(txCuentaC, gridBagConstraints);

        jLabel47.setText("Moda:........................................");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 100, 0, 0);
        jPanel10.add(jLabel47, gridBagConstraints);

        jLabel48.setText("Media:........................................");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(10, 100, 0, 0);
        jPanel10.add(jLabel48, gridBagConstraints);

        jLabel49.setText("Maximo:......................................");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 9;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 100, 0, 0);
        jPanel10.add(jLabel49, gridBagConstraints);

        jLabel50.setText("Rango:.......................................");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 7;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 100, 0, 0);
        jPanel10.add(jLabel50, gridBagConstraints);

        jLabel51.setText("Suma:........................................");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 10;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 100, 0, 0);
        jPanel10.add(jLabel51, gridBagConstraints);

        btnCalcular2.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        btnCalcular2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recursos/Control Panel-16.png"))); // NOI18N
        btnCalcular2.setText("Calcular");
        btnCalcular2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCalcular2ActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 12, 0, 0);
        jPanel10.add(btnCalcular2, gridBagConstraints);

        btnNuevo2.setText("Agregar Datos");
        btnNuevo2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNuevo2ActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 25, 0, 0);
        jPanel10.add(btnNuevo2, gridBagConstraints);

        btnEliminarCon.setText("Eliminar");
        btnEliminarCon.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEliminarConActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.insets = new java.awt.Insets(5, 12, 0, 0);
        jPanel10.add(btnEliminarCon, gridBagConstraints);

        jLabel62.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel62.setText("RESULTADOS:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 12;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.insets = new java.awt.Insets(25, 0, 0, 0);
        jPanel10.add(jLabel62, gridBagConstraints);

        jLabel68.setText("UNIFORME:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 13;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(25, 100, 0, 0);
        jPanel10.add(jLabel68, gridBagConstraints);

        jLabel69.setText("EXPONENCIAL:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 14;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 100, 0, 0);
        jPanel10.add(jLabel69, gridBagConstraints);

        comboNConfianza.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0.80", "0.90", "0.95", "0.98", "0.99" }));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 3;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 12, 0, 0);
        jPanel10.add(comboNConfianza, gridBagConstraints);

        jLabel37.setText("N Confianza:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 3;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(15, 12, 0, 0);
        jPanel10.add(jLabel37, gridBagConstraints);

        jLabel23.setText("TRIANGULAR:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 15;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 100, 0, 0);
        jPanel10.add(jLabel23, gridBagConstraints);

        javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15);
        jPanel15.setLayout(jPanel15Layout);
        jPanel15Layout.setHorizontalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );
        jPanel15Layout.setVerticalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );

        jPanel10.add(jPanel15, new java.awt.GridBagConstraints());

        btnHistoCont.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recursos/Chart-flipped-32.png"))); // NOI18N
        btnHistoCont.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnHistoContActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 3;
        gridBagConstraints.gridy = 16;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 10, 0);
        jPanel10.add(btnHistoCont, gridBagConstraints);

        labelRUNI.setText(".......");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 13;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST;
        gridBagConstraints.insets = new java.awt.Insets(25, 0, 0, 100);
        jPanel10.add(labelRUNI, gridBagConstraints);

        labelREXP.setText(".......");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 14;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST;
        gridBagConstraints.insets = new java.awt.Insets(6, 0, 0, 100);
        jPanel10.add(labelREXP, gridBagConstraints);

        labelRTRI.setText(".......");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 15;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST;
        gridBagConstraints.insets = new java.awt.Insets(6, 0, 0, 100);
        jPanel10.add(labelRTRI, gridBagConstraints);

        jTabbedPane3.addTab("Datos Continuos", jPanel10);

        TBuniforme.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        jScrollPane9.setViewportView(TBuniforme);

        jLabel52.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel52.setText("PARAMETROS:");

        Paneluniforme.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        javax.swing.GroupLayout PaneluniformeLayout = new javax.swing.GroupLayout(Paneluniforme);
        Paneluniforme.setLayout(PaneluniformeLayout);
        PaneluniformeLayout.setHorizontalGroup(
            PaneluniformeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 331, Short.MAX_VALUE)
        );
        PaneluniformeLayout.setVerticalGroup(
            PaneluniformeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 269, Short.MAX_VALUE)
        );

        jLabel53.setText("A......");

        jLabel54.setText("B......");

        txt_A.setEditable(false);

        txt_B.setEditable(false);

        jLabel55.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel55.setText("D Calculado");

        DCalculadoUni.setEditable(false);
        DCalculadoUni.setBackground(new java.awt.Color(153, 204, 255));

        jLabel56.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel56.setText("Prueba KS:");

        TEST_KS_UNI.setEditable(false);
        TEST_KS_UNI.setBackground(new java.awt.Color(153, 204, 255));

        jLabel58.setText("GENERAR ALEATORIOS");

        PaneluniformeAle.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        javax.swing.GroupLayout PaneluniformeAleLayout = new javax.swing.GroupLayout(PaneluniformeAle);
        PaneluniformeAle.setLayout(PaneluniformeAleLayout);
        PaneluniformeAleLayout.setHorizontalGroup(
            PaneluniformeAleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 325, Short.MAX_VALUE)
        );
        PaneluniformeAleLayout.setVerticalGroup(
            PaneluniformeAleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );

        jLabel59.setText("#....");

        TBuniformeAle.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        jScrollPane10.setViewportView(TBuniformeAle);

        bntGenAleUni.setText("Generar");
        bntGenAleUni.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bntGenAleUniActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel11Layout.createSequentialGroup()
                .addGap(33, 33, 33)
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addComponent(jLabel52)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel11Layout.createSequentialGroup()
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jScrollPane10, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                            .addComponent(jSeparator2, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel56, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel11Layout.createSequentialGroup()
                                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel54)
                                    .addComponent(jLabel55)
                                    .addComponent(jLabel53))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(txt_A)
                                    .addComponent(DCalculadoUni)
                                    .addComponent(txt_B)))
                            .addComponent(TEST_KS_UNI))
                        .addGap(18, 18, 18))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel11Layout.createSequentialGroup()
                        .addComponent(jLabel58, javax.swing.GroupLayout.DEFAULT_SIZE, 120, Short.MAX_VALUE)
                        .addGap(79, 79, 79))
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addComponent(jLabel59)
                        .addGap(18, 18, 18)
                        .addComponent(txtCantidadUni, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(bntGenAleUni)
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addComponent(PaneluniformeAle, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(Paneluniforme, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, 670, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(26, 26, 26))
        );
        jPanel11Layout.setVerticalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addGap(35, 35, 35)
                .addComponent(jLabel52)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel53)
                            .addComponent(txt_A, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel54)
                            .addComponent(txt_B, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel55)
                            .addComponent(DCalculadoUni, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel56)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(TEST_KS_UNI, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, 201, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(Paneluniforme, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(PaneluniformeAle, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addComponent(jLabel58)
                        .addGap(20, 20, 20)
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel59)
                            .addComponent(txtCantidadUni, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(bntGenAleUni))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jScrollPane10, javax.swing.GroupLayout.PREFERRED_SIZE, 201, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(31, Short.MAX_VALUE))
        );

        jTabbedPane3.addTab("UNIFORME", jPanel11);

        TBexponencial.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        jScrollPane11.setViewportView(TBexponencial);

        jLabel60.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel60.setText("PARAMETROS:");

        PanelExponencial.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        javax.swing.GroupLayout PanelExponencialLayout = new javax.swing.GroupLayout(PanelExponencial);
        PanelExponencial.setLayout(PanelExponencialLayout);
        PanelExponencialLayout.setHorizontalGroup(
            PanelExponencialLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 331, Short.MAX_VALUE)
        );
        PanelExponencialLayout.setVerticalGroup(
            PanelExponencialLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 269, Short.MAX_VALUE)
        );

        jLabel61.setText("Lamda:");

        txt_LambaExp.setEditable(false);

        jLabel63.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel63.setText("D Calculado:");

        DCalculadoExp.setEditable(false);
        DCalculadoExp.setBackground(new java.awt.Color(153, 204, 255));

        jLabel64.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel64.setText("Prueba KS:");

        TEST_KS_EXP.setEditable(false);
        TEST_KS_EXP.setBackground(new java.awt.Color(153, 204, 255));

        jLabel66.setText("GENERAR ALEATORIOS");

        PanelExponencialAle.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        javax.swing.GroupLayout PanelExponencialAleLayout = new javax.swing.GroupLayout(PanelExponencialAle);
        PanelExponencialAle.setLayout(PanelExponencialAleLayout);
        PanelExponencialAleLayout.setHorizontalGroup(
            PanelExponencialAleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 325, Short.MAX_VALUE)
        );
        PanelExponencialAleLayout.setVerticalGroup(
            PanelExponencialAleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );

        jLabel67.setText("#....");

        TBexponencialAle.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        jScrollPane12.setViewportView(TBexponencialAle);

        bntGenAleExp.setText("Generar");
        bntGenAleExp.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bntGenAleExpActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
        jPanel12.setLayout(jPanel12Layout);
        jPanel12Layout.setHorizontalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel12Layout.createSequentialGroup()
                .addGap(33, 33, 33)
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel12Layout.createSequentialGroup()
                        .addComponent(jLabel66, javax.swing.GroupLayout.DEFAULT_SIZE, 120, Short.MAX_VALUE)
                        .addGap(79, 79, 79))
                    .addGroup(jPanel12Layout.createSequentialGroup()
                        .addComponent(jLabel67)
                        .addGap(18, 18, 18)
                        .addComponent(txtCantidadExp, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(bntGenAleExp)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(jPanel12Layout.createSequentialGroup()
                        .addComponent(jLabel60)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel12Layout.createSequentialGroup()
                        .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(TEST_KS_EXP, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jSeparator3, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel64, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jScrollPane12, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel12Layout.createSequentialGroup()
                                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel61)
                                    .addComponent(jLabel63))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(txt_LambaExp)
                                    .addComponent(DCalculadoExp))))
                        .addGap(18, 18, 18)))
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel12Layout.createSequentialGroup()
                        .addComponent(PanelExponencialAle, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(PanelExponencial, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane11, javax.swing.GroupLayout.PREFERRED_SIZE, 670, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(26, 26, 26))
        );
        jPanel12Layout.setVerticalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addGap(35, 35, 35)
                .addComponent(jLabel60)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel12Layout.createSequentialGroup()
                        .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel61)
                            .addComponent(txt_LambaExp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel63)
                            .addComponent(DCalculadoExp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel64)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(TEST_KS_EXP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane11, javax.swing.GroupLayout.PREFERRED_SIZE, 201, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(PanelExponencial, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(PanelExponencialAle, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanel12Layout.createSequentialGroup()
                        .addComponent(jLabel66)
                        .addGap(20, 20, 20)
                        .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel67)
                            .addComponent(txtCantidadExp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(bntGenAleExp))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jScrollPane12, javax.swing.GroupLayout.PREFERRED_SIZE, 201, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(31, Short.MAX_VALUE))
        );

        jTabbedPane3.addTab("EXPONENCIAL", jPanel12);

        TBtriangular.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        jScrollPane15.setViewportView(TBtriangular);

        jLabel73.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel73.setText("PARAMETROS:");

        Paneltriangular.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        javax.swing.GroupLayout PaneltriangularLayout = new javax.swing.GroupLayout(Paneltriangular);
        Paneltriangular.setLayout(PaneltriangularLayout);
        PaneltriangularLayout.setHorizontalGroup(
            PaneltriangularLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 331, Short.MAX_VALUE)
        );
        PaneltriangularLayout.setVerticalGroup(
            PaneltriangularLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 269, Short.MAX_VALUE)
        );

        jLabel78.setText("A......");

        jLabel79.setText("B......");

        txt_At.setEditable(false);

        txt_Bt.setEditable(false);

        jLabel80.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel80.setText("D Calculado");

        DCalculadoTri.setEditable(false);
        DCalculadoTri.setBackground(new java.awt.Color(153, 204, 255));

        jLabel81.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel81.setText("Prueba KS:");

        TEST_KS_TRI.setEditable(false);
        TEST_KS_TRI.setBackground(new java.awt.Color(153, 204, 255));

        jLabel83.setText("GENERAR ALEATORIOS");

        PaneltriangularAle.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        javax.swing.GroupLayout PaneltriangularAleLayout = new javax.swing.GroupLayout(PaneltriangularAle);
        PaneltriangularAle.setLayout(PaneltriangularAleLayout);
        PaneltriangularAleLayout.setHorizontalGroup(
            PaneltriangularAleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 325, Short.MAX_VALUE)
        );
        PaneltriangularAleLayout.setVerticalGroup(
            PaneltriangularAleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );

        jLabel84.setText("#....");

        TBtriangularAle.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        jScrollPane16.setViewportView(TBtriangularAle);

        bntGenAleTri.setText("Generar");
        bntGenAleTri.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bntGenAleTriActionPerformed(evt);
            }
        });

        jLabel85.setText("C......");

        txt_Ct.setEditable(false);

        javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
        jPanel14.setLayout(jPanel14Layout);
        jPanel14Layout.setHorizontalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel14Layout.createSequentialGroup()
                .addGap(33, 33, 33)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel14Layout.createSequentialGroup()
                        .addComponent(jLabel73)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel14Layout.createSequentialGroup()
                        .addComponent(jLabel83, javax.swing.GroupLayout.DEFAULT_SIZE, 120, Short.MAX_VALUE)
                        .addGap(79, 79, 79))
                    .addGroup(jPanel14Layout.createSequentialGroup()
                        .addComponent(jLabel84)
                        .addGap(18, 18, 18)
                        .addComponent(txtCantidadTri, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(bntGenAleTri)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel14Layout.createSequentialGroup()
                        .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(TEST_KS_TRI, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane16, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel14Layout.createSequentialGroup()
                                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel79)
                                    .addComponent(jLabel78))
                                .addGap(44, 44, 44)
                                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(txt_At)
                                    .addComponent(txt_Bt)))
                            .addComponent(jSeparator5, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel81, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel14Layout.createSequentialGroup()
                                .addComponent(jLabel80)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(DCalculadoTri))
                            .addGroup(jPanel14Layout.createSequentialGroup()
                                .addComponent(jLabel85)
                                .addGap(44, 44, 44)
                                .addComponent(txt_Ct)))
                        .addGap(18, 18, 18)))
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel14Layout.createSequentialGroup()
                        .addComponent(PaneltriangularAle, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(Paneltriangular, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane15, javax.swing.GroupLayout.PREFERRED_SIZE, 670, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(26, 26, 26))
        );
        jPanel14Layout.setVerticalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel14Layout.createSequentialGroup()
                .addGap(35, 35, 35)
                .addComponent(jLabel73)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel14Layout.createSequentialGroup()
                        .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel78)
                            .addComponent(txt_At, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel79)
                            .addComponent(txt_Bt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel85)
                            .addComponent(txt_Ct, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 38, Short.MAX_VALUE)
                        .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel80)
                            .addComponent(DCalculadoTri, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jSeparator5, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel81)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(TEST_KS_TRI, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane15, javax.swing.GroupLayout.PREFERRED_SIZE, 201, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(Paneltriangular, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(PaneltriangularAle, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanel14Layout.createSequentialGroup()
                        .addComponent(jLabel83)
                        .addGap(20, 20, 20)
                        .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel84)
                            .addComponent(txtCantidadTri, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(bntGenAleTri))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jScrollPane16, javax.swing.GroupLayout.PREFERRED_SIZE, 201, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(30, Short.MAX_VALUE))
        );

        jTabbedPane3.addTab("TRIANGULAR", jPanel14);

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 933, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane3)
                .addContainerGap())
        );

        panelBienvenido.addTab("DISTRIBUCIONES CONTINUAS", jPanel9);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(panelBienvenido)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(panelBienvenido, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(13, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

public void graficar(){
    try {
            Grafico migrafico = new Grafico();
            //tamaño del grafico
            Dimension d = panelGrafico1.getSize();//toma el tamaño del contenedor
            //se crean dos arrays list
            ArrayList a = new ArrayList(); //guardara los datos de la columna p(x) de la tb FRECUENCIA
            ArrayList b = new ArrayList(); //guardara los datos de la columna P(DATOS_BIN) de la tb FRECUENCIA

            operaciones.llenarArray_px(a); //se llama al metodo que hara la consulta y la guardara en el array respectivo
     
            //se crea el grafico
            migrafico.crear_grafico_de_barras(d, a, "serie p(x)","PROBABILIDAD");
            //se crea un jlabel para colocar el grafico
            JLabel j = new JLabel();
            j.setBounds(0, 0, d.width, d.height);
            //se carga el grafico de memoria
            migrafico.cargar_grafico(j);
            //se añade al contenedor
            panelGrafico1.add(j);
            this.repaint();
        
            //se repite el procedimiento anterior para el panelGrafico2

            operaciones.llenarArray_PX(b);

            //se crea el grafico
            migrafico.crear_grafico_de_barras(d, b, "serie P(X)","ACUMULADA");
            //se crea un jlabel para colocar el grafico
            JLabel k = new JLabel();
            k.setBounds(0, 0, d.width, d.height);
            //se carga el grafico de memoria
            migrafico.cargar_grafico(k);
            //se añade al contenedor
            panelGrafico2.add(k);
            this.repaint();
            
        } catch (SQLException ex) {
            Logger.getLogger(ventanaPrincipal.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        
} 

public static BigInteger factorial(int n) {
    BigInteger f = new BigInteger("1");

    for (int i = 1; i <= n; i++) {
        f = f.multiply(new BigInteger(i + ""));
    }
    return f;
    }

public void calculoChiBin(){
        
        DATOS_BIN.clear();
        combinaBIN.clear();
        BIN_PX.clear();
        FO_BIN.clear();
        FE_BIN.clear();
        
        try {
            operaciones.llenarArray_DATOS_BIN(DATOS_BIN);

        
        int N = Integer.valueOf(txt_N.getText());
        BigInteger comb;
        for(int i = 0;i<DATOS_BIN.size();i++){
            comb = factorial(N).divide(factorial((int) DATOS_BIN.get(i)).multiply(factorial(N-(int)DATOS_BIN.get(i))));
            System.out.println(comb);
            //operaciones.insertar("INSERT INTO BINO_TEMP VALUES("+comb+")");
            operaciones.insertar("UPDATE BINOMIAL SET COMB="+comb+" WHERE DATOS="+DATOS_BIN.get(i)+"");
        }
        
            operaciones.llenarArray_COMB_BIN(combinaBIN);

        
        double P = Double.valueOf(txt_p.getText());
        
        for(int i = 0;i<combinaBIN.size();i++){
                      
            double px=(double)combinaBIN.get(i)*Math.pow(P, (int) DATOS_BIN.get(i))*Math.pow(1.-P, N-(int) DATOS_BIN.get(i));
            operaciones.insertar("UPDATE BINOMIAL SET PX="+px+" WHERE DATOS="+DATOS_BIN.get(i)+"");
        }
        
            operaciones.llenarArray_BINPX(BIN_PX);

        
        for(int i = 0;i<BIN_PX.size();i++){
                      
            double FE = N* (double)BIN_PX.get(i);
            operaciones.insertar("UPDATE BINOMIAL SET FE="+FE+" WHERE DATOS="+DATOS_BIN.get(i)+"");
        }
        
        operaciones.llenarArray_FO_BIN(FO_BIN);
        operaciones.llenarArray_FE_BIN(FE_BIN);
        
        for(int i = 0;i<FO_BIN.size();i++){
                      
            double CHI = Math.pow((double)FE_BIN.get(i)-(double)FO_BIN.get(i),2)/(double)FE_BIN.get(i);
            operaciones.insertar("UPDATE BINOMIAL SET CHI="+CHI+" WHERE DATOS="+DATOS_BIN.get(i)+"");
        }
        
        txtChiBinCalculado.setText(operaciones.sumaChiBin());
        
           
                } catch (SQLException ex) {
            Logger.getLogger(ventanaPrincipal.class.getName()).log(Level.SEVERE, null, ex);
        }
}

public void calculoChiPoi(){
        
        DATOS_POI.clear();
        combinaPOI.clear();
        POI_PX.clear();
        FO_POI.clear();
        FE_POI.clear();

        try {
            operaciones.llenarArray_DATOS_POI(DATOS_POI);

        
        double media = Double.valueOf(txMediaD.getText());
        int cuenta = Integer.valueOf(txCuentaD.getText());
        
        BigInteger comb;
        
        for(int i = 0;i<DATOS_POI.size();i++){
            comb = factorial((int)DATOS_POI.get(i));
            System.out.println(comb);
            operaciones.insertar("UPDATE POISSON SET COMB="+comb+" WHERE DATOS="+DATOS_POI.get(i)+"");
        }
        
        operaciones.llenarArray_COMB_POI(combinaPOI);
        
        for(int i = 0;i<combinaPOI.size();i++){
                      
            double px=((Math.exp(-media))*Math.pow(media, (int)DATOS_POI.get(i)))/(double)combinaPOI.get(i);
            operaciones.insertar("UPDATE POISSON SET PX="+px+" WHERE DATOS="+DATOS_POI.get(i)+"");
        }
        
            operaciones.llenarArray_POIPX(POI_PX);

        
        for(int i = 0;i<POI_PX.size();i++){
                      
            double FE = cuenta* (double)POI_PX.get(i);
            operaciones.insertar("UPDATE POISSON SET FE="+FE+" WHERE DATOS="+DATOS_BIN.get(i)+"");
        }
        
        operaciones.llenarArray_FO_POI(FO_POI);
        operaciones.llenarArray_FE_POI(FE_POI);
        
        for(int i = 0;i<FO_BIN.size();i++){
                      
            double CHI = Math.pow((double)FE_POI.get(i)-(double)FO_POI.get(i),2)/(double)FE_POI.get(i);
            operaciones.insertar("UPDATE POISSON SET CHI="+CHI+" WHERE DATOS="+DATOS_BIN.get(i)+"");
        }
        
        txtChiPoiCalculado.setText(operaciones.sumaChiPoi());
        
           
                } catch (SQLException ex) {
            Logger.getLogger(ventanaPrincipal.class.getName()).log(Level.SEVERE, null, ex);
        }
}



public void graficarHisto(){
    try {
            Grafico migrafico = new Grafico();
            //tamaño del grafico
            Dimension d = panelHistograma.getSize();//toma el tamaño del contenedor
            //se crean dos arrays list
            ArrayList x = new ArrayList(); //guardara los datos de la columna ACUM de la tb FRECUENCIA_MUESTRAS

            operaciones.llenarArray_PROB_MUE(x); //se llama al metodo que hara la consulta y la guardara en el array respectivo
            
            
     
            //se crea el grafico
            migrafico.crear_grafico_de_lineas(d, x, "serie ACUM","HISTOGRAMA");
            //se crea un jlabel para colocar el grafico
            JLabel j = new JLabel();
            j.setBounds(0, 0, d.width, d.height);
            //se carga el grafico de memoria
            migrafico.cargar_grafico(j);
            //se añade al contenedor
            panelHistograma.add(j);
            this.repaint();
        
        } catch (SQLException ex) {
            Logger.getLogger(ventanaPrincipal.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        
} 

public void graficarBino(){
    try {
            Grafico migrafico = new Grafico();
            //tamaño del grafico
            Dimension d = Panelbinomial.getSize();//toma el tamaño del contenedor
            //se crean dos arrays list
            ArrayList x = new ArrayList(); //guardara los datos de la columna FE
            ArrayList y = new ArrayList(); //guardara los datos de la columna FE

            operaciones.llenarArray_FE_BIN(x); //se llama al metodo que hara la consulta y la guardara en el array respectivo
            operaciones.llenarArray_FO_BIN(y);
     
            //se crea el grafico
            migrafico.crear_grafico_de_lineas_2(d, x,y, "serie FE","serie FO","Grafico binomial");
            //se crea un jlabel para colocar el grafico
            JLabel j = new JLabel();
            j.setBounds(0, 0, d.width, d.height);
            //se carga el grafico de memoria
            migrafico.cargar_grafico(j);
            //se añade al contenedor
            Panelbinomial.add(j);
            this.repaint();
        
        } catch (SQLException ex) {
            Logger.getLogger(ventanaPrincipal.class.getName()).log(Level.SEVERE, null, ex);
        }
            
} 

public void graficarPoi(){
    try {
            Grafico migrafico = new Grafico();
            //tamaño del grafico
            Dimension d = PanelPoisson.getSize();//toma el tamaño del contenedor
            //se crean dos arrays list
            ArrayList x = new ArrayList(); //guardara los datos de la columna FE
            ArrayList y = new ArrayList(); //guardara los datos de la columna FE

            operaciones.llenarArray_FE_POI(x); //se llama al metodo que hara la consulta y la guardara en el array respectivo
            operaciones.llenarArray_FO_POI(y);
     
            //se crea el grafico
            migrafico.crear_grafico_de_lineas_2(d, x,y, "serie FE","serie FO","Grafico poisson");
            //se crea un jlabel para colocar el grafico
            JLabel j = new JLabel();
            j.setBounds(0, 0, d.width, d.height);
            //se carga el grafico de memoria
            migrafico.cargar_grafico(j);
            //se añade al contenedor
            PanelPoisson.add(j);
            this.repaint();
        
        } catch (SQLException ex) {
            Logger.getLogger(ventanaPrincipal.class.getName()).log(Level.SEVERE, null, ex);
        }
            
} 
public void graficarUni(){
    try {
            Grafico migrafico = new Grafico();
            //tamaño del grafico
            Dimension d = Paneluniforme.getSize();//toma el tamaño del contenedor
            //se crean dos arrays list
            ArrayList x = new ArrayList(); //guardara los datos de la columna FE
            ArrayList y = new ArrayList(); //guardara los datos de la columna FE

            operaciones.llenarArray_POAI(x); //se llama al metodo que hara la consulta y la guardara en el array respectivo
            operaciones.llenarArray_PEAI(y);
     
            //se crea el grafico
            migrafico.crear_grafico_de_lineas_2(d, x,y, "serie POAI","serie PEAI","Grafico uniforme");
            //se crea un jlabel para colocar el grafico
            JLabel j = new JLabel();
            j.setBounds(0, 0, d.width, d.height);
            //se carga el grafico de memoria
            migrafico.cargar_grafico(j);
            //se añade al contenedor
            Paneluniforme.add(j);
            this.repaint();
        
        } catch (SQLException ex) {
            Logger.getLogger(ventanaPrincipal.class.getName()).log(Level.SEVERE, null, ex);
        }
            
} 

public void graficarExpo(){
    try {
            Grafico migrafico = new Grafico();
            //tamaño del grafico
            Dimension d = PanelExponencial.getSize();//toma el tamaño del contenedor
            //se crean dos arrays list
            ArrayList x = new ArrayList(); //guardara los datos de la columna FE
            ArrayList y = new ArrayList(); //guardara los datos de la columna FE

            operaciones.llenarArray_POAI_EXP(x); //se llama al metodo que hara la consulta y la guardara en el array respectivo
            operaciones.llenarArray_PEAI_EXP(y);
     
            //se crea el grafico
            migrafico.crear_grafico_de_lineas_2(d, x,y, "serie POAI","serie PEAI","Grafico exponencial");
            //se crea un jlabel para colocar el grafico
            JLabel j = new JLabel();
            j.setBounds(0, 0, d.width, d.height);
            //se carga el grafico de memoria
            migrafico.cargar_grafico(j);
            //se añade al contenedor
            PanelExponencial.add(j);
            this.repaint();
        
        } catch (SQLException ex) {
            Logger.getLogger(ventanaPrincipal.class.getName()).log(Level.SEVERE, null, ex);
        }
            
} 

public void graficarTri(){
    try {
            Grafico migrafico = new Grafico();
            //tamaño del grafico
            Dimension d = Paneltriangular.getSize();//toma el tamaño del contenedor
            //se crean dos arrays list
            ArrayList x = new ArrayList(); //guardara los datos de la columna FE
            ArrayList y = new ArrayList(); //guardara los datos de la columna FE

            operaciones.llenarArray_POAI_TRI(x); //se llama al metodo que hara la consulta y la guardara en el array respectivo
            operaciones.llenarArray_PEAI_TRI(y);
     
            //se crea el grafico
            migrafico.crear_grafico_de_lineas_2(d, x,y, "serie POAI","serie PEAI","Grafico triangular");
            //se crea un jlabel para colocar el grafico
            JLabel j = new JLabel();
            j.setBounds(0, 0, d.width, d.height);
            //se carga el grafico de memoria
            migrafico.cargar_grafico(j);
            //se añade al contenedor
            Paneltriangular.add(j);
            this.repaint();
        
        } catch (SQLException ex) {
            Logger.getLogger(ventanaPrincipal.class.getName()).log(Level.SEVERE, null, ex);
        }
            
} 

public void graficarBinoAle(){

            Grafico migrafico = new Grafico();
            //tamaño del grafico
            Dimension d = PanelbinomialAle.getSize();//toma el tamaño del contenedor

            int x = randomBino.size();
            double vector[] = new double[x];
            
            for (int i=0;i<x;i++){
                vector[i]=(double) randomBino.get(i);
            }
             
            
            //se crea el grafico
            migrafico.crear_grafico_histograma(d, vector,"Serie Aleatoria","Histograma aleatorio Binomial", x);
            //se crea un jlabel para colocar el grafico
            JLabel j = new JLabel();
            j.setBounds(0, 0, d.width, d.height);
            //se carga el grafico de memoria
            migrafico.cargar_grafico(j);
            //se añade al contenedor
            PanelbinomialAle.add(j);
            this.repaint();
    
} 

public void graficarPoiAle(){

            Grafico migrafico = new Grafico();
            //tamaño del grafico
            Dimension d = PanelAlePoisson.getSize();//toma el tamaño del contenedor

            int x = randomPoi.size();
            double vector[] = new double[x];
            
            for (int i=0;i<x;i++){
                vector[i]=(double) randomPoi.get(i);
            }
             
            
            //se crea el grafico
            migrafico.crear_grafico_histograma(d, vector,"Serie Aleatoria","Histograma aleatorio Poisson", x);
            //se crea un jlabel para colocar el grafico
            JLabel j = new JLabel();
            j.setBounds(0, 0, d.width, d.height);
            //se carga el grafico de memoria
            migrafico.cargar_grafico(j);
            //se añade al contenedor
            PanelAlePoisson.add(j);
            this.repaint();
    
} 

public void graficarTriAle(){

            Grafico migrafico = new Grafico();
            //tamaño del grafico
            Dimension d = PaneltriangularAle.getSize();//toma el tamaño del contenedor

            int x = randomTri.size();
            double vector[] = new double[x];
            
            for (int i=0;i<x;i++){
                vector[i]=(double) randomTri.get(i);
            }
             
            
            //se crea el grafico
            migrafico.crear_grafico_histograma(d, vector,"Serie Aleatoria","Histograma aleatorio Triangular", 10);
            //se crea un jlabel para colocar el grafico
            JLabel j = new JLabel();
            j.setBounds(0, 0, d.width, d.height);
            //se carga el grafico de memoria
            migrafico.cargar_grafico(j);
            //se añade al contenedor
            PaneltriangularAle.add(j);
            this.repaint();
    
} 

public void graficarUniAle(){

            Grafico migrafico = new Grafico();
            //tamaño del grafico
            Dimension d = PaneluniformeAle.getSize();//toma el tamaño del contenedor

            int x = randomUni.size();
            double vector[] = new double[x];
            
            for (int i=0;i<x;i++){
                vector[i]=(double) randomUni.get(i);
            }
             
            
            //se crea el grafico
            migrafico.crear_grafico_histograma(d, vector,"Serie Aleatoria","Histograma aleatorio Uniforme", 10);
            //se crea un jlabel para colocar el grafico
            JLabel j = new JLabel();
            j.setBounds(0, 0, d.width, d.height);
            //se carga el grafico de memoria
            migrafico.cargar_grafico(j);
            //se añade al contenedor
            PaneluniformeAle.add(j);
            this.repaint();
    
} 

public void graficarExpAle(){

            Grafico migrafico = new Grafico();
            //tamaño del grafico
            Dimension d = PanelExponencialAle.getSize();//toma el tamaño del contenedor

            int x = randomExpo.size();
            double vector[] = new double[x];
            
            for (int i=0;i<x;i++){
                vector[i]=(double) randomExpo.get(i);
            }
             
            
            //se crea el grafico
            migrafico.crear_grafico_histograma(d, vector,"Serie Aleatoria","Histograma aleatorio Esponencial", x);
            //se crea un jlabel para colocar el grafico
            JLabel j = new JLabel();
            j.setBounds(0, 0, d.width, d.height);
            //se carga el grafico de memoria
            migrafico.cargar_grafico(j);
            //se añade al contenedor
            PanelExponencialAle.add(j);
            this.repaint();
    
} 



public void calcularEstadistica(){
    try {
            if(tbDatos.getRowCount()==0)
                JOptionPane.showMessageDialog(null, "Insertar datos");
            else{
            txMedia.setText(operaciones.media_dato_1());
            //txMediana.setText(operaciones.mediana_dato_1());
            txModa.setText(operaciones.moda_dato_1());
            double desviacion = Math.sqrt(Double.valueOf(operaciones.varianza_dato_1()));
            txDesviacion.setText(String.format("%.3f", desviacion));
            txVarianza.setText(operaciones.varianza_dato_1());
            txRango.setText(operaciones.rango_dato_1());
            txMaximo.setText(operaciones.max_dato_1());
            txMinimo.setText(operaciones.min_dato_1());
            txSuma.setText(operaciones.suma_dato_1());
            txCuenta.setText(operaciones.cuenta_dato_1());
            }


        } catch (SQLException ex) {
            Logger.getLogger(ventanaPrincipal.class.getName()).log(Level.SEVERE, null, ex);
        }

}

public void calcularEstadisticaDiscreta(){
    try {
            if(tbDatosDiscretos.getRowCount()==0)
                JOptionPane.showMessageDialog(null, "Insertar datos");
            else{
            txMediaD.setText(operaciones.mediaDD());
            //txMediana.setText(operaciones.mediana_dato_1());
            txModaD.setText(operaciones.modaDD());
            double desviacion = Math.sqrt(Double.valueOf(operaciones.varianzaDD()));
            txDesviacionD.setText(String.format("%.3f", desviacion));
            txVarianzaD.setText(operaciones.varianzaDD());
            txRangoD.setText(operaciones.rangoDD());
            txMaximoD.setText(operaciones.maxDD());
            txMinimoD.setText(operaciones.minDD());
            txSumaD.setText(operaciones.sumaDD());
            txCuentaD.setText(operaciones.cuentaDD());
            
            //calculo de los parametros de la binomial
            txt_N.setText(txCuentaD.getText());
            Double Prob;
            Prob=Double.valueOf(txMediaD.getText())/Double.valueOf(txCuentaD.getText());
            txt_p.setText(String.valueOf(Prob));
            txtLamdaPoisson.setText(txMediaD.getText());
            }
            
            pruebaChi();


        } catch (SQLException ex) {
            Logger.getLogger(ventanaPrincipal.class.getName()).log(Level.SEVERE, null, ex);
        }

}


public void calcularEstadisticaContinua(){
    try {
            if(tbDatosContinuos.getRowCount()==0)
                JOptionPane.showMessageDialog(null, "Insertar datos");
            else{
            txMediaC.setText(operaciones.mediaC());
            //txMediana.setText(operaciones.mediana_dato_1());
            txModaC.setText(operaciones.modaC());
            double desviacion = Math.sqrt(Double.valueOf(operaciones.varianzaC()));
            double varianza = Double.valueOf(operaciones.varianzaC());
            txDesviacionC.setText(String.format("%.5f", desviacion).replace(",", "."));
            txVarianzaC.setText(String.format("%.5f", varianza).replace(",", "."));
            txRangoC.setText(operaciones.rangoC());
            txMaximoC.setText(operaciones.maxC());
            txMinimoC.setText(operaciones.minC());
            txSumaC.setText(operaciones.sumaC());
            txCuentaC.setText(operaciones.cuentaC());
            
            //parametros uniforme
            
            txt_A.setText(txMinimoC.getText());
            txt_B.setText(txMaximoC.getText());
            
            //parametros exponencial
            
            double media = Double.valueOf(operaciones.mediaC());
            double lambda = 1./media;
            
            txt_LambaExp.setText(String.format("%.5f", lambda).replace(",", "."));
            
            //parametros triangular
            
            txt_At.setText(txMinimoC.getText());
            txt_Bt.setText(txMaximoC.getText());
            txt_Ct.setText(txModaC.getText());
            
            
            }


        } catch (SQLException ex) {
            Logger.getLogger(ventanaPrincipal.class.getName()).log(Level.SEVERE, null, ex);
        }

}

public String ContarDatosContinuos() throws SQLException{
               
        Statement psd = cn.createStatement();

        String sql = "SELECT COUNT(*) AS CONTEO FROM DATOS_CONTINUOS";
        ResultSet rs = psd.executeQuery(sql);
        String temp="";
        while(rs.next()){
            temp= rs.getString("CONTEO");          
        }
        return temp;
    }

public String ConsultarTablaKS(String columna, String n) throws SQLException{
               
        Statement psd = cn.createStatement();

        String sql = "SELECT "+columna+" as VALOR FROM KS_  WHERE \"n\" ="+n+"";
        ResultSet rs = psd.executeQuery(sql);
        String temp="";
        while(rs.next()){
            temp= rs.getString("VALOR");          
        }
        return temp;
    }

public void pruebaKS(){
 
        try {
            String columna="";
            String resultado="";
            double R;
            if(comboNConfianza.getSelectedItem().equals("0.80"))
                columna="C_080";
            else if(comboNConfianza.getSelectedItem().equals("0.90"))
                columna="C_090";
            else if(comboNConfianza.getSelectedItem().equals("0.95"))
                columna="C_095";
            else if(comboNConfianza.getSelectedItem().equals("0.98"))
                columna="C_098";
            else if(comboNConfianza.getSelectedItem().equals("0.99"))
                columna="C_099";

            int n = Integer.valueOf(ContarDatosContinuos());
            
            if(n<=50){
                resultado = ConsultarTablaKS(columna,ContarDatosContinuos());
            }
            else if(n>50 && columna.equals("C_080")){
                R=1.073/Math.sqrt(n);
                resultado = String.valueOf(R);
            }else if(n>50 && columna.equals("C_090")){
                R=1.223/Math.sqrt(n);
                resultado = String.valueOf(R);
            }else if(n>50 && columna.equals("C_095")){
                R=1.358/Math.sqrt(n);
                resultado = String.valueOf(R);
            }else if(n>50 && columna.equals("C_098")){
                R=1.518/Math.sqrt(n);
                resultado = String.valueOf(R);
            }else if(n>50 && columna.equals("C_099")){
                R=1.629/Math.sqrt(n);
                resultado = String.valueOf(R);
            }
            

            TEST_KS_EXP.setText(resultado);
            TEST_KS_UNI.setText(resultado);
            TEST_KS_TRI.setText(resultado);
        } catch (SQLException ex) {
            Logger.getLogger(ventanaPrincipal.class.getName()).log(Level.SEVERE, null, ex);
        }
            

}


public String ConsultarTablaChi(String columna, String v) throws SQLException{
               
        Statement psd = cn.createStatement();

        String sql = "SELECT \""+columna+"\" as VALOR FROM \"_chi_2__\" WHERE V="+v+"";
        ResultSet rs = psd.executeQuery(sql);
        String temp="";
        while(rs.next()){
            temp= rs.getString("VALOR");          
        }
        return temp;
    }

public String ContarDatosBin() throws SQLException{
               
        Statement psd = cn.createStatement();

        String sql = "SELECT COUNT(*) AS CONTEO FROM BINOMIAL";
        ResultSet rs = psd.executeQuery(sql);
        String temp="";
        while(rs.next()){
            temp= rs.getString("CONTEO");          
        }
        return temp;
    }

public void pruebaChi(){
        try {
            String columna="";
            if(comboAlfa.getSelectedItem().equals("0.999"))
                columna="_0999";
            else if(comboAlfa.getSelectedItem().equals("0.995"))
                columna="_0995";
            else if(comboAlfa.getSelectedItem().equals("0.99"))
                columna="_099";
            else if(comboAlfa.getSelectedItem().equals("0.975"))
                columna="_0975";
            else if(comboAlfa.getSelectedItem().equals("0.95"))
                columna="_095";
            else if(comboAlfa.getSelectedItem().equals("0.90"))
                columna="_090";
            else if(comboAlfa.getSelectedItem().equals("0.75"))
                columna="_075";
            else if(comboAlfa.getSelectedItem().equals("0.50"))
                columna="_050";
            else if(comboAlfa.getSelectedItem().equals("0.25"))
                columna="_025";
            else if(comboAlfa.getSelectedItem().equals("0.10"))
                columna="_010";
            else if(comboAlfa.getSelectedItem().equals("0.05"))
                columna="_005";
            else if(comboAlfa.getSelectedItem().equals("0.025"))
                columna="_0025";
            else if(comboAlfa.getSelectedItem().equals("0.01"))
                columna="_001";
            else if(comboAlfa.getSelectedItem().equals("0.005"))
                columna="_0005";
            else if(comboAlfa.getSelectedItem().equals("0.001"))
                columna="_0001";
            
            String resultado = ConsultarTablaChi(columna,ContarDatosBin());
            

            TEST_CHI2.setText(resultado);
            TEST_CHI2_pos.setText(resultado);
        } catch (SQLException ex) {
            Logger.getLogger(ventanaPrincipal.class.getName()).log(Level.SEVERE, null, ex);
        }

}

public void calcularCriticoExp(){
    try {
            // TODO add your handling code here:
            DCalculadoExp.setText(operaciones.MaxCriticoExpo());
            //pruebaKS();
            operaciones.mostrarExponencial((DefaultTableModel)TBexponencial.getModel());
            PanelExponencial.removeAll();
            this.repaint();
        } catch (SQLException ex) {
            Logger.getLogger(ventanaPrincipal.class.getName()).log(Level.SEVERE, null, ex);
        }
}

public void calcularCriticoUni(){
    try {
            // TODO add your handling code here:
            
            DCalculadoUni.setText(operaciones.MaxCriticoUniforme());
            //pruebaKS();
            operaciones.mostrarUniforme((DefaultTableModel)TBuniforme.getModel());
            Paneluniforme.removeAll();
            this.repaint();
            
        } catch (SQLException ex) {
            Logger.getLogger(ventanaPrincipal.class.getName()).log(Level.SEVERE, null, ex);
        }
}

public void calcularCriticoTri(){
    try {
            // TODO add your handling code here:
            
            DCalculadoTri.setText(operaciones.MaxCriticoTriangular());
            //pruebaKS();
            operaciones.mostrarTri((DefaultTableModel)TBtriangular.getModel());
            Paneltriangular.removeAll();
            this.repaint();
            
        } catch (SQLException ex) {
            Logger.getLogger(ventanaPrincipal.class.getName()).log(Level.SEVERE, null, ex);
        }
}

public void calcularCriticoBin(){

            calculoChiBin();
            pruebaChi();
            Panelbinomial.removeAll();
            operaciones.mostrarBinomial((DefaultTableModel)TBbinomial.getModel());
        
}

public void calcularCriticoPoi(){

            calculoChiPoi();
            pruebaChi();
            Panelbinomial.removeAll();
            operaciones.mostrarPoisson((DefaultTableModel)TBpoisson.getModel());
        
}

public int muestra_aleatoria(){
        
        NumAleatorio = Math.random();  
        for(int i = 0;i<o.size();i++){
            if(NumAleatorio <= Double.valueOf(p.get(i).toString())){           
                valor = Integer.valueOf(String.format("%.0f", o.get(i)));
                break;
            } 
        }
        System.gc();
        return valor;      
}

private void btnNuevoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNuevoActionPerformed
         new agregarDatos(this, true).setVisible(true);
}//GEN-LAST:event_btnNuevoActionPerformed

    private void btnCalFrecActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCalFrecActionPerformed
        if(tbDatos.getRowCount()==0)
           JOptionPane.showMessageDialog(null, "Ingrese datos");
        else{
        sw1=1;
        //vaciando los arraylist
        o.clear();
        p.clear();
        
    
        //remover graficos frecuencias

        ventanaPrincipal.panelGrafico1.removeAll();
        ventanaPrincipal.panelGrafico2.removeAll();
        operaciones.insertar("SET GENERATOR ID TO 0;");
        operaciones.insertar("DELETE FROM MUESTRAS");
        operaciones.insertar("DELETE FROM FREC_TEMP2");
        operaciones.insertar("DELETE FROM FRECUENCIA_MUESTRAS");
        operaciones.mostrarClases((DefaultTableModel)tbFrecuencia.getModel());
        //llenar arrays o y p
        try {
            
            operaciones.llenarArray_DATOS_FREC(o);
            operaciones.llenarArray_PX(p);
        } 
        catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, ex);
        }
        }
    }//GEN-LAST:event_btnCalFrecActionPerformed

    private void btnGraficarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGraficarActionPerformed
        if(sw1==0 || tbFrecuencia.getRowCount()==0)
            JOptionPane.showMessageDialog(null, "Calcular frecuencias");
        else{
            graficar();
        }
        
    }//GEN-LAST:event_btnGraficarActionPerformed

    private void btnCalcularActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCalcularActionPerformed
        operaciones.insertar("SET GENERATOR ID TO 0;");
        calcularEstadistica();
    }//GEN-LAST:event_btnCalcularActionPerformed

    private void btnAleatorioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAleatorioActionPerformed
        if(tbFrecuencia.getRowCount()==0)
            JOptionPane.showMessageDialog(null, "Calcular frecuencias");
        else{
        
        NumAleatorio = Math.random();
        txtAleatorio.setText(String.format("%.3f", NumAleatorio));
        
        for(int i = 0;i<o.size();i++){
            if(NumAleatorio <= Double.valueOf(p.get(i).toString())){      
                txtDatoAleatorio.setText(String.format("%.0f", o.get(i)));
                break;      
            }
            System.gc();
        }
        
        }
                 
    }//GEN-LAST:event_btnAleatorioActionPerformed

    private void btnEliminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEliminarActionPerformed
        Icon icono  =  new ImageIcon("src/Recursos/Alert-64.png"); 
        
        if (JOptionPane.showConfirmDialog(null, "Se eliminaran TODOS LOS DATOS ", "ADVERTENCIA",
            JOptionPane.YES_NO_OPTION,0,icono) == JOptionPane.YES_OPTION) {
                          
            try{

                operaciones.insertar("DELETE FROM DATOS");
                operaciones.insertar("DELETE FROM FREC_TEMP");
                operaciones.insertar("DELETE FROM FRECUENCIA");
                operaciones.insertar("DELETE FROM MUESTRAS");
                operaciones.insertar("DELETE FROM FREC_TEMP2");
                operaciones.insertar("DELETE FROM FRECUENCIA_MUESTRAS");
                
                //actualizar la tabla DATOS
                operaciones.mostrarDatos((DefaultTableModel)ventanaPrincipal.tbDatos.getModel());
                operaciones.mostrarDatos((DefaultTableModel)ventanaPrincipal.tbFrecuencia.getModel());
                operaciones.mostrarDatos((DefaultTableModel)ventanaPrincipal.tbMuestras.getModel());
                operaciones.mostrarDatos((DefaultTableModel)ventanaPrincipal.tbMuestrasFrec.getModel());
                
                ventanaPrincipal.txMedia.setText("");
                ventanaPrincipal.txModa.setText("");
                ventanaPrincipal.txRango.setText("");
                ventanaPrincipal.txDesviacion.setText("");
                ventanaPrincipal.txVarianza.setText("");
                ventanaPrincipal.txRango.setText("");
                ventanaPrincipal.txMinimo.setText("");
                ventanaPrincipal.txMaximo.setText("");
                ventanaPrincipal.txSuma.setText("");
                ventanaPrincipal.txCuenta.setText("");
                ventanaPrincipal.txtAleatorio.setText("");
                ventanaPrincipal.txtDatoAleatorio.setText("");
                ventanaPrincipal.panelGrafico1.removeAll();
                ventanaPrincipal.panelGrafico2.removeAll();
                ventanaPrincipal.panelHistograma.removeAll();
                JOptionPane.showMessageDialog(null,"Se elimino todo con exito");
                ventanaPrincipal.o.clear();
                ventanaPrincipal.p.clear();
            
            }catch(Exception ex){
                JOptionPane.showMessageDialog(null,"Error al eliminar", "Error" ,JOptionPane.ERROR_MESSAGE);
            }
            
            } else {
            // no hacer nada
        }
    }//GEN-LAST:event_btnEliminarActionPerformed

    private void btnMuestrasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnMuestrasActionPerformed
        if(txtDatoAleatorio.getText().isEmpty())
            JOptionPane.showMessageDialog(null, "Generar el numero aleatorio"); 
        else if (tbFrecuencia.getRowCount()==0)
            JOptionPane.showMessageDialog(null, "Calcular frecuencias");
        else if(txtCantidad.getText().isEmpty())
            JOptionPane.showMessageDialog(null, "Ingrese la cantidad de muestras");
        else{
            
        operaciones.insertar("DELETE FROM MUESTRAS");
        int limite;
        limite = Integer.valueOf(txtCantidad.getText());
        

        
        try {
            
            Statement psd=cn.createStatement();
            for(int i=0;i<limite;i++){
                psd.executeUpdate("insert into MUESTRAS values("+muestra_aleatoria()+")");
            }
            System.out.println("fin");
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, ex);
        }
        
          
        //actualizar la tabla MUESTRAS
        operaciones.mostrarMuestras((DefaultTableModel)ventanaPrincipal.tbMuestras.getModel());
        System.gc();    //liberando memoria
        }
    }//GEN-LAST:event_btnMuestrasActionPerformed

    private void btnCalcularFrecMueActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCalcularFrecMueActionPerformed
            if(tbMuestras.getRowCount()==0){
                JOptionPane.showMessageDialog(null, "Inserte muestras aleatorias");
            }
            else{
            //remover grafico histograma
            ventanaPrincipal.panelHistograma.removeAll();
            operaciones.insertar("SET GENERATOR ID TO 0;");
            operaciones.mostrarMuestrasFrec((DefaultTableModel)ventanaPrincipal.tbMuestrasFrec.getModel());
            sw2=1;
            }
    }//GEN-LAST:event_btnCalcularFrecMueActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        if(sw2==0 || tbMuestrasFrec.getRowCount()==0)
             JOptionPane.showMessageDialog(null, "Calcular nuevas frecuencias");
        else
            graficarHisto();
    }//GEN-LAST:event_jButton1ActionPerformed

    private void btnMuestrasMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnMuestrasMousePressed
        // TODO add your handling code here:
        carga.setText("Generando muestras...espere");
    }//GEN-LAST:event_btnMuestrasMousePressed

    private void btnMuestrasMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnMuestrasMouseReleased
        // TODO add your handling code here:
        carga.setText("");
    }//GEN-LAST:event_btnMuestrasMouseReleased

    private void btnCalcular1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCalcular1ActionPerformed
        // TODO add your handling code here:
        calcularEstadisticaDiscreta();
        calcularCriticoBin();
        calcularCriticoPoi();

        graficarBino();
        graficarPoi();
        
        operaciones.insertar("DELETE FROM BINOMIAL_RANDOM");
        operaciones.insertar("DELETE FROM POISSON_RANDOM");
        
        PanelbinomialAle.removeAll();
        PanelAlePoisson.removeAll();
        
        operaciones.mostrarBinomialAle((DefaultTableModel)ventanaPrincipal.TBbinomialaAle.getModel());
        operaciones.mostrarPoissonlAle((DefaultTableModel)ventanaPrincipal.TBpoissonAle.getModel());
        
        double chiBinCalculado = Double.valueOf(txtChiBinCalculado.getText());
        double chiPoiCalculado = Double.valueOf(txtChiPoiCalculado.getText());
        double testChi= Double.valueOf(TEST_CHI2.getText());
        
        if(chiBinCalculado<testChi){
            labelRBIN.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recursos/SI.png"))); 
            labelRBIN.setText("SI");
            txtCantidadBin.setEnabled(true);
            bntGenAleBin.setEnabled(true);
        }
            
        else{
            labelRBIN.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recursos/NO.png"))); 
            labelRBIN.setText("NO");
            txtCantidadBin.setEnabled(false);
            bntGenAleBin.setEnabled(false);
        }
        
         if(chiPoiCalculado<testChi){
            labelRPOI.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recursos/SI.png"))); 
            labelRPOI.setText("SI");
            txtCantidadPos.setEnabled(true);
            bntGenAlePos.setEnabled(true);
        }
            
        else{
            labelRPOI.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recursos/NO.png"))); 
            labelRPOI.setText("NO");
            txtCantidadPos.setEnabled(false);
            bntGenAlePos.setEnabled(false);
        }
            
    }//GEN-LAST:event_btnCalcular1ActionPerformed

    private void btnNuevo1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNuevo1ActionPerformed
        // TODO add your handling code here:
        new AgregarDatosDiscretos(this, true).setVisible(true);
    }//GEN-LAST:event_btnNuevo1ActionPerformed

    private void btnEliminarDisActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEliminarDisActionPerformed
        // TODO add your handling code here:
        Icon icono  =  new ImageIcon("src/Recursos/Alert-64.png");
         if (JOptionPane.showConfirmDialog(null, "Se eliminaran TODOS LOS DATOS ", "ADVERTENCIA",
            JOptionPane.YES_NO_OPTION,0,icono) == JOptionPane.YES_OPTION) {
            
            try{

                operaciones.insertar("DELETE FROM DATOS_DISCRETOS");
    
                //actualizar la tabla DATOS
                operaciones.mostrarDatosDiscretos((DefaultTableModel)ventanaPrincipal.tbDatosDiscretos.getModel());

                
                ventanaPrincipal.txMediaD.setText("");
                ventanaPrincipal.txModaD.setText("");
                ventanaPrincipal.txRangoD.setText("");
                ventanaPrincipal.txDesviacionD.setText("");
                ventanaPrincipal.txVarianzaD.setText("");
                ventanaPrincipal.txRangoD.setText("");
                ventanaPrincipal.txMinimoD.setText("");
                ventanaPrincipal.txMaximoD.setText("");
                ventanaPrincipal.txSumaD.setText("");
                ventanaPrincipal.txCuentaD.setText("");
                ventanaPrincipal.Panelbinomial.removeAll();
                ventanaPrincipal.PanelbinomialAle.removeAll();
                ventanaPrincipal.PanelPoisson.removeAll();
                ventanaPrincipal.PanelAlePoisson.removeAll();
                labelRPOI.setIcon(new javax.swing.ImageIcon(getClass().getResource(""))); 
                labelRPOI.setText(".......");
                labelRBIN.setIcon(new javax.swing.ImageIcon(getClass().getResource("")));
                labelRBIN.setText(".......");
                
                operaciones.mostrarBinomial((DefaultTableModel)ventanaPrincipal.TBbinomial.getModel());
                operaciones.mostrarBinomialAle((DefaultTableModel)ventanaPrincipal.TBbinomialaAle.getModel());
                operaciones.mostrarPoisson((DefaultTableModel)ventanaPrincipal.TBpoisson.getModel());
                operaciones.mostrarPoissonlAle((DefaultTableModel)ventanaPrincipal.TBpoissonAle.getModel());
                
            
            }catch(Exception ex){
                JOptionPane.showMessageDialog(null,"Error al eliminar", "Error" ,JOptionPane.ERROR_MESSAGE);
            }
            
            } else {
            // no hacer nada
        }
    }//GEN-LAST:event_btnEliminarDisActionPerformed

    private void bntGenAleBinActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bntGenAleBinActionPerformed
        try {
            // TODO add your handling code here:
            randomBino.clear();
            PanelbinomialAle.removeAll();
            operaciones.insertar("DELETE FROM BINOMIAL_RANDOM");
            long n = Long.valueOf(txt_N.getText());
            double P = Double.valueOf(txt_p.getText());
            int cantidad = Integer.valueOf(txtCantidadBin.getText());
            Binomial m = new Binomial(n, P);
            double numero;
         
            Statement psd=cn.createStatement();
            
            for(int i=0;i<cantidad;i++){
                numero = m.random();
                randomBino.add(numero);
                psd.executeUpdate("INSERT INTO BINOMIAL_RANDOM VALUES("+numero+")");
            }
            operaciones.mostrarBinomialAle((DefaultTableModel)TBbinomialaAle.getModel());
            graficarBinoAle();
        } catch (SQLException ex) {
            Logger.getLogger(ventanaPrincipal.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_bntGenAleBinActionPerformed

    private void btnCalcular2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCalcular2ActionPerformed
        // TODO add your handling code here:
        calcularEstadisticaContinua();
        
        operaciones.insertar("SET GENERATOR ID2 TO 0;");
        operaciones.insertar("SET GENERATOR ID3 TO 0;");
        operaciones.insertar("SET GENERATOR ID4 TO 0;");
        operaciones.insertar("DELETE FROM UNI_TEMP;");
        operaciones.insertar("DELETE FROM UNIFORME;");
        operaciones.insertar("DELETE FROM EXP_TEMP;");
        operaciones.insertar("DELETE FROM EXPONENCIAL;");
        operaciones.insertar("DELETE FROM TRI_TEMP;");
        operaciones.insertar("DELETE FROM TRIANGULAR;");
        operaciones.insertar("UPDATE DATOS_CONTINUOS SET TEMP=0 WHERE NUM=(SELECT first 1 NUM FROM DATOS_CONTINUOS);");
        operaciones.insertar("UPDATE UNIFORME SET TEMP=0;");
        operaciones.insertar("UPDATE EXPONENCIAL SET TEMP=0;");
        operaciones.insertar("UPDATE TRIANGULAR SET TEMP=0;");
        
        operaciones.insertar("DELETE FROM TRIANGULAR_RANDOM");
        operaciones.insertar("DELETE FROM UNIFORME_RANDOM");
        operaciones.insertar("DELETE FROM EXPONENCIAL_RANDOM");

        calcularCriticoUni();
        calcularCriticoExp();
        calcularCriticoTri();
        graficarUni();
        graficarExpo();
        graficarTri();
        pruebaKS();
        
        PaneluniformeAle.removeAll();
        PanelExponencialAle.removeAll();
        PaneltriangularAle.removeAll();
        operaciones.mostrarUniformeAle((DefaultTableModel)ventanaPrincipal.TBuniformeAle.getModel());
        operaciones.mostrarExponencialAle((DefaultTableModel)ventanaPrincipal.TBexponencialAle.getModel());
        operaciones.mostrarTriAle((DefaultTableModel)ventanaPrincipal.TBtriangularAle.getModel());
        
        double CalculadoExp = Double.valueOf(DCalculadoExp.getText());
        double TestKSExp = Double.valueOf(TEST_KS_EXP.getText());
        
        double CalculadoUni = Double.valueOf(DCalculadoUni.getText());
        double TestKSUni = Double.valueOf(TEST_KS_UNI.getText());
        
        double CalculadoTri = Double.valueOf(DCalculadoTri.getText());
        double TestKSTri = Double.valueOf(TEST_KS_TRI.getText());
        
        //Comparando si los valores calculados son mayores o menores a los criticos
        
        if(CalculadoExp< TestKSExp){
            labelREXP.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recursos/SI.png"))); 
            labelREXP.setText("SI");
            txtCantidadExp.setEnabled(true);
            bntGenAleExp.setEnabled(true);
        }
        else{
            labelREXP.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recursos/NO.png"))); 
            labelREXP.setText("NO");
            txtCantidadExp.setEnabled(false);
            bntGenAleExp.setEnabled(false);
        }
            
        if(CalculadoUni < TestKSUni){
            labelRUNI.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recursos/SI.png"))); 
            labelRUNI.setText("SI");
            txtCantidadUni.setEnabled(true);
            bntGenAleUni.setEnabled(true);
        }
        else{
            labelRUNI.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recursos/NO.png"))); 
            labelRUNI.setText("NO");
            txtCantidadUni.setEnabled(false);
            bntGenAleUni.setEnabled(false);
            
        }
        
        if(CalculadoTri < TestKSTri){
            labelRTRI.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recursos/SI.png"))); 
            labelRTRI.setText("SI");
            txtCantidadTri.setEnabled(true);
            bntGenAleTri.setEnabled(true);
        }
        else{
            labelRTRI.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recursos/NO.png"))); 
            labelRTRI.setText("NO");
            txtCantidadTri.setEnabled(false);
            txtCantidadTri.setEnabled(false);
            
        }
      
    }//GEN-LAST:event_btnCalcular2ActionPerformed

    private void btnNuevo2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNuevo2ActionPerformed
        // TODO add your handling code here:
        new AgregarDatosContinuos(this, true).setVisible(true);

    }//GEN-LAST:event_btnNuevo2ActionPerformed

    private void btnEliminarConActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEliminarConActionPerformed
        // TODO add your handling code here:
        Icon icono  =  new ImageIcon("src/Recursos/Alert-64.png");
            
            if (JOptionPane.showConfirmDialog(null, "Se eliminaran TODOS LOS DATOS ", "ADVERTENCIA",
            JOptionPane.YES_NO_OPTION,0,icono) == JOptionPane.YES_OPTION) {

            try{

                operaciones.insertar("DELETE FROM DATOS_CONTINUOS");

                operaciones.mostrarDatosContinuos((DefaultTableModel)ventanaPrincipal.tbDatosContinuos.getModel());
       
                ventanaPrincipal.txMediaC.setText("");
                ventanaPrincipal.txModaC.setText("");
                ventanaPrincipal.txRangoC.setText("");
                ventanaPrincipal.txDesviacionC.setText("");
                ventanaPrincipal.txVarianzaC.setText("");
                ventanaPrincipal.txRangoC.setText("");
                ventanaPrincipal.txMinimoC.setText("");
                ventanaPrincipal.txMaximoC.setText("");
                ventanaPrincipal.txSumaC.setText("");
                ventanaPrincipal.txCuentaC.setText("");
                ventanaPrincipal.Paneluniforme.removeAll();
                ventanaPrincipal.PaneluniformeAle.removeAll();
                ventanaPrincipal.PanelExponencial.removeAll();
                ventanaPrincipal.PanelExponencialAle.removeAll();
                ventanaPrincipal.Paneltriangular.removeAll();
                ventanaPrincipal.PaneltriangularAle.removeAll();
                labelRTRI.setIcon(new javax.swing.ImageIcon(getClass().getResource(""))); 
                labelRTRI.setText(".......");
                labelREXP.setIcon(new javax.swing.ImageIcon(getClass().getResource(""))); 
                labelREXP.setText(".......");
                labelRUNI.setIcon(new javax.swing.ImageIcon(getClass().getResource(""))); 
                labelRUNI.setText(".......");
                ventanaPrincipal.txt_A.setText("");
                ventanaPrincipal.txt_B.setText("");
                ventanaPrincipal.DCalculadoUni.setText("");
                ventanaPrincipal.TEST_KS_UNI.setText("");
                ventanaPrincipal.txt_LambaExp.setText("");
                ventanaPrincipal.DCalculadoExp.setText("");
                ventanaPrincipal.TEST_KS_EXP.setText("");
                ventanaPrincipal.txt_At.setText("");
                ventanaPrincipal.txt_Bt.setText("");
                ventanaPrincipal.txt_Ct.setText("");
                ventanaPrincipal.DCalculadoTri.setText("");
                ventanaPrincipal.TEST_KS_TRI.setText("");
                
                operaciones.mostrarUniforme((DefaultTableModel)ventanaPrincipal.TBuniforme.getModel());
                operaciones.mostrarUniformeAle((DefaultTableModel)ventanaPrincipal.TBuniformeAle.getModel());
                operaciones.mostrarExponencial((DefaultTableModel)ventanaPrincipal.TBexponencial.getModel());    
                operaciones.mostrarExponencialAle((DefaultTableModel)ventanaPrincipal.TBexponencialAle.getModel());
                operaciones.mostrarTri((DefaultTableModel)ventanaPrincipal.TBtriangular.getModel());
                operaciones.mostrarTriAle((DefaultTableModel)ventanaPrincipal.TBtriangularAle.getModel());
                
                
            
            }catch(Exception ex){
                JOptionPane.showMessageDialog(null,"Error al eliminar", "Error" ,JOptionPane.ERROR_MESSAGE);
            }
            
            } else {
            // no hacer nada
        }
    }//GEN-LAST:event_btnEliminarConActionPerformed

    private void bntGenAleUniActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bntGenAleUniActionPerformed
        // TODO add your handling code here:
        try {
            // TODO add your handling code here:
            randomUni.clear();
            PaneluniformeAle.removeAll();
            operaciones.insertar("DELETE FROM UNIFORME_RANDOM");
            double A = Double.valueOf(txt_A.getText());
            double B = Double.valueOf(txt_B.getText());
            int cantidad = Integer.valueOf(txtCantidadUni.getText());
            Uniform m = new Uniform(A, B);
            double numero;
         
            Statement psd=cn.createStatement();
            
            for(int i=0;i<cantidad;i++){
                numero = m.random();
                randomUni.add(numero);
                psd.executeUpdate("INSERT INTO UNIFORME_RANDOM VALUES("+numero+")");
            }
            operaciones.mostrarUniformeAle((DefaultTableModel)TBuniformeAle.getModel());
            graficarUniAle();
        } catch (SQLException ex) {
            Logger.getLogger(ventanaPrincipal.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_bntGenAleUniActionPerformed

    private void bntGenAleExpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bntGenAleExpActionPerformed
        // TODO add your handling code here:
        try {
            // TODO add your handling code here:
            randomExpo.clear();
            PanelExponencialAle.removeAll();
            operaciones.insertar("DELETE FROM EXPONENCIAL_RANDOM");
            double media = Double.valueOf(txMediaC.getText());

            int cantidad = Integer.valueOf(txtCantidadExp.getText());
            Exponential m = new Exponential(media);
            double numero;
         
            Statement psd=cn.createStatement();
            
            for(int i=0;i<cantidad;i++){
                numero = m.random();
                randomExpo.add(numero);
                psd.executeUpdate("INSERT INTO EXPONENCIAL_RANDOM VALUES("+numero+")");
            }
            operaciones.mostrarExponencialAle((DefaultTableModel)TBexponencialAle.getModel());
            graficarExpAle();
        } catch (SQLException ex) {
            Logger.getLogger(ventanaPrincipal.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_bntGenAleExpActionPerformed

    private void bntGenAlePosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bntGenAlePosActionPerformed
        // TODO add your handling code here:
        try {
            // TODO add your handling code here:
            randomPoi.clear();
            PanelAlePoisson.removeAll();
            operaciones.insertar("DELETE FROM POISSON_RANDOM");
            double lamda = Double.valueOf(txtLamdaPoisson.getText());

            int cantidad = Integer.valueOf(txtCantidadPos.getText());
            Poisson m = new Poisson(lamda);
            double numero;
         
            Statement psd=cn.createStatement();
            
            for(int i=0;i<cantidad;i++){
                numero = m.random();
                randomPoi.add(numero);
                psd.executeUpdate("INSERT INTO POISSON_RANDOM VALUES("+numero+")");
            }
            operaciones.mostrarPoissonlAle((DefaultTableModel)TBpoissonAle.getModel());
            graficarPoiAle();
        } catch (SQLException ex) {
            Logger.getLogger(ventanaPrincipal.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_bntGenAlePosActionPerformed

    private void bntGenAleTriActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bntGenAleTriActionPerformed
        try {
            // TODO add your handling code here:
            
            randomTri.clear();
            PaneltriangularAle.removeAll();
            operaciones.insertar("DELETE FROM TRIANGULAR_RANDOM");
            int cantidad = Integer.valueOf(txtCantidadTri.getText());
            
            double R;
            double A=Double.valueOf(txt_At.getText());
            double B=Double.valueOf(txt_Bt.getText());
            double C=Double.valueOf(txt_Ct.getText());
            double condicion = (C-A)/(B-A);
            
            double X;
            
            Statement psd=cn.createStatement();
            
            for(int i=0;i<cantidad;i++){
                R=Math.random();
                if(R<=condicion){
                    X = A+Math.sqrt(R*(B-A)*(C-A));
                }else{
                    X = B-Math.sqrt((1-R)*(B-A)*(B-C));             
                }
                
                randomTri.add(X);
                psd.executeUpdate("INSERT INTO TRIANGULAR_RANDOM VALUES("+X+")");
                
            }
            
            operaciones.mostrarTriAle((DefaultTableModel)TBtriangularAle.getModel());
            graficarTriAle();
        } catch (SQLException ex) {
            Logger.getLogger(ventanaPrincipal.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        
        
    }//GEN-LAST:event_bntGenAleTriActionPerformed

    private void btnHistoContActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnHistoContActionPerformed
        // TODO add your handling code here:
        Icon icono  =  new ImageIcon("src/Recursos/Info-64.png");
        
        if(tbDatosContinuos.getRowCount()==0){
            JOptionPane.showMessageDialog(null," Debe ingresar datos primero ", "Advertencia",JOptionPane.PLAIN_MESSAGE, icono);
        }else{
        new HistogramaContinuo(this, true).setVisible(true);
        }
        
    }//GEN-LAST:event_btnHistoContActionPerformed

    private void btnHistoDistActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnHistoDistActionPerformed
        // TODO add your handling code here:
        Icon icono  =  new ImageIcon("src/Recursos/Info-64.png");

        if(tbDatosDiscretos.getRowCount()==0){
            JOptionPane.showMessageDialog(null," Debe ingresar datos primero ", "Advertencia",JOptionPane.PLAIN_MESSAGE, icono);
        }else{
        new HistogramaDiscreto(this, true).setVisible(true);
        }
    }//GEN-LAST:event_btnHistoDistActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(ventanaPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                new ventanaPrincipal().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    public static javax.swing.JTextField DCalculadoExp;
    public static javax.swing.JTextField DCalculadoTri;
    public static javax.swing.JTextField DCalculadoUni;
    public static javax.swing.JPanel PanelAlePoisson;
    public static javax.swing.JPanel PanelExponencial;
    public static javax.swing.JPanel PanelExponencialAle;
    public static javax.swing.JPanel PanelPoisson;
    public static javax.swing.JPanel Panelbinomial;
    public static javax.swing.JPanel PanelbinomialAle;
    public static javax.swing.JPanel Paneltriangular;
    public static javax.swing.JPanel PaneltriangularAle;
    public static javax.swing.JPanel Paneluniforme;
    public static javax.swing.JPanel PaneluniformeAle;
    public static javax.swing.JTable TBbinomial;
    public static javax.swing.JTable TBbinomialaAle;
    public static javax.swing.JTable TBexponencial;
    public static javax.swing.JTable TBexponencialAle;
    public static javax.swing.JTable TBpoisson;
    public static javax.swing.JTable TBpoissonAle;
    public static javax.swing.JTable TBtriangular;
    public static javax.swing.JTable TBtriangularAle;
    public static javax.swing.JTable TBuniforme;
    public static javax.swing.JTable TBuniformeAle;
    private javax.swing.JTextField TEST_CHI2;
    private javax.swing.JTextField TEST_CHI2_pos;
    public static javax.swing.JTextField TEST_KS_EXP;
    public static javax.swing.JTextField TEST_KS_TRI;
    public static javax.swing.JTextField TEST_KS_UNI;
    private javax.swing.JButton bntGenAleBin;
    private javax.swing.JButton bntGenAleExp;
    private javax.swing.JButton bntGenAlePos;
    private javax.swing.JButton bntGenAleTri;
    private javax.swing.JButton bntGenAleUni;
    private javax.swing.JButton btnAleatorio;
    private javax.swing.JButton btnCalFrec;
    private javax.swing.JButton btnCalcular;
    private javax.swing.JButton btnCalcular1;
    private javax.swing.JButton btnCalcular2;
    private javax.swing.JButton btnCalcularFrecMue;
    private javax.swing.JButton btnEliminar;
    private javax.swing.JButton btnEliminarCon;
    private javax.swing.JButton btnEliminarDis;
    private javax.swing.JButton btnGraficar;
    private javax.swing.JButton btnHistoCont;
    private javax.swing.JButton btnHistoDist;
    private javax.swing.JButton btnMuestras;
    private javax.swing.JButton btnNuevo;
    private javax.swing.JButton btnNuevo1;
    private javax.swing.JButton btnNuevo2;
    private javax.swing.JLabel carga;
    private javax.swing.JComboBox comboAlfa;
    private javax.swing.JComboBox comboNConfianza;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel39;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel40;
    private javax.swing.JLabel jLabel41;
    private javax.swing.JLabel jLabel42;
    private javax.swing.JLabel jLabel43;
    private javax.swing.JLabel jLabel44;
    private javax.swing.JLabel jLabel45;
    private javax.swing.JLabel jLabel46;
    private javax.swing.JLabel jLabel47;
    private javax.swing.JLabel jLabel48;
    private javax.swing.JLabel jLabel49;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel50;
    private javax.swing.JLabel jLabel51;
    private javax.swing.JLabel jLabel52;
    private javax.swing.JLabel jLabel53;
    private javax.swing.JLabel jLabel54;
    private javax.swing.JLabel jLabel55;
    private javax.swing.JLabel jLabel56;
    private javax.swing.JLabel jLabel58;
    private javax.swing.JLabel jLabel59;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel60;
    private javax.swing.JLabel jLabel61;
    private javax.swing.JLabel jLabel62;
    private javax.swing.JLabel jLabel63;
    private javax.swing.JLabel jLabel64;
    private javax.swing.JLabel jLabel65;
    private javax.swing.JLabel jLabel66;
    private javax.swing.JLabel jLabel67;
    private javax.swing.JLabel jLabel68;
    private javax.swing.JLabel jLabel69;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel70;
    private javax.swing.JLabel jLabel71;
    private javax.swing.JLabel jLabel72;
    private javax.swing.JLabel jLabel73;
    private javax.swing.JLabel jLabel74;
    private javax.swing.JLabel jLabel75;
    private javax.swing.JLabel jLabel76;
    private javax.swing.JLabel jLabel77;
    private javax.swing.JLabel jLabel78;
    private javax.swing.JLabel jLabel79;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel80;
    private javax.swing.JLabel jLabel81;
    private javax.swing.JLabel jLabel83;
    private javax.swing.JLabel jLabel84;
    private javax.swing.JLabel jLabel85;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel14;
    private javax.swing.JPanel jPanel15;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane10;
    private javax.swing.JScrollPane jScrollPane11;
    private javax.swing.JScrollPane jScrollPane12;
    private javax.swing.JScrollPane jScrollPane13;
    private javax.swing.JScrollPane jScrollPane14;
    private javax.swing.JScrollPane jScrollPane15;
    private javax.swing.JScrollPane jScrollPane16;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JScrollPane jScrollPane9;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JSeparator jSeparator3;
    private javax.swing.JSeparator jSeparator4;
    private javax.swing.JSeparator jSeparator5;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTabbedPane jTabbedPane2;
    private javax.swing.JTabbedPane jTabbedPane3;
    private javax.swing.JLabel labelRBIN;
    private javax.swing.JLabel labelREXP;
    private javax.swing.JLabel labelRPOI;
    private javax.swing.JLabel labelRTRI;
    private javax.swing.JLabel labelRUNI;
    private javax.swing.JTabbedPane panelBienvenido;
    public static javax.swing.JPanel panelGrafico1;
    public static javax.swing.JPanel panelGrafico2;
    public static javax.swing.JPanel panelHistograma;
    public static javax.swing.JTable tbDatos;
    public static javax.swing.JTable tbDatosContinuos;
    public static javax.swing.JTable tbDatosDiscretos;
    public static javax.swing.JTable tbFrecuencia;
    public static javax.swing.JTable tbMuestras;
    public static javax.swing.JTable tbMuestrasFrec;
    public static javax.swing.JTextField txCuenta;
    public static javax.swing.JTextField txCuentaC;
    public static javax.swing.JTextField txCuentaD;
    public static javax.swing.JTextField txDesviacion;
    public static javax.swing.JTextField txDesviacionC;
    public static javax.swing.JTextField txDesviacionD;
    public static javax.swing.JTextField txMaximo;
    public static javax.swing.JTextField txMaximoC;
    public static javax.swing.JTextField txMaximoD;
    public static javax.swing.JTextField txMedia;
    public static javax.swing.JTextField txMediaC;
    public static javax.swing.JTextField txMediaD;
    public static javax.swing.JTextField txMinimo;
    public static javax.swing.JTextField txMinimoC;
    public static javax.swing.JTextField txMinimoD;
    public static javax.swing.JTextField txModa;
    public static javax.swing.JTextField txModaC;
    public static javax.swing.JTextField txModaD;
    public static javax.swing.JTextField txRango;
    public static javax.swing.JTextField txRangoC;
    public static javax.swing.JTextField txRangoD;
    public static javax.swing.JTextField txSuma;
    public static javax.swing.JTextField txSumaC;
    public static javax.swing.JTextField txSumaD;
    public static javax.swing.JTextField txVarianza;
    public static javax.swing.JTextField txVarianzaC;
    public static javax.swing.JTextField txVarianzaD;
    public static javax.swing.JTextField txtAleatorio;
    private javax.swing.JTextField txtCantidad;
    private javax.swing.JTextField txtCantidadBin;
    private javax.swing.JTextField txtCantidadExp;
    private javax.swing.JTextField txtCantidadPos;
    private javax.swing.JTextField txtCantidadTri;
    private javax.swing.JTextField txtCantidadUni;
    private javax.swing.JTextField txtChiBinCalculado;
    private javax.swing.JTextField txtChiPoiCalculado;
    public static javax.swing.JTextField txtDatoAleatorio;
    private javax.swing.JTextField txtLamdaPoisson;
    public static javax.swing.JTextField txt_A;
    public static javax.swing.JTextField txt_At;
    public static javax.swing.JTextField txt_B;
    public static javax.swing.JTextField txt_Bt;
    public static javax.swing.JTextField txt_Ct;
    public static javax.swing.JTextField txt_LambaExp;
    private javax.swing.JTextField txt_N;
    private javax.swing.JTextField txt_p;
    // End of variables declaration//GEN-END:variables
}
